Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An organization or a project with the slug 'new' or a user with the username 'add' will conflict with the add functions #285

Closed
seav opened this issue Jun 29, 2016 · 8 comments
Assignees
Milestone

Comments

@seav
Copy link
Contributor

seav commented Jun 29, 2016

Currently, the URLs to add a new organization, project, and user are:
/organizations/new/
/organizations/<org-slug>/projects/new/
/organizations/<org-slug>/members/add/

And the URLs to view the organization and project, and to edit the org member permissions are:
/organizations/<org-slug>/
/organizations/<org-slug>/projects/<project-slug>/
/organizations/<org-slug>/members/<username>/

If the org or project slug is 'new' you can't view the organization or project at all. If the username is 'add', you can't use the above URL to edit this user's permissions. You need to go into each project and change the user's permissions there instead.

@seav seav added the bug label Jun 29, 2016
@wonderchook
Copy link
Contributor

@seav are there any other similar situations to this?

@wonderchook wonderchook added this to the Version 0.1 milestone Jun 30, 2016
@seav
Copy link
Contributor Author

seav commented Jun 30, 2016

Probably, but I haven't checked thoroughly. I only noticed this particular bug when I was fixing #263.

@seav
Copy link
Contributor Author

seav commented Jun 30, 2016

I looked at the code and tried it on the platform: Organizations and Projects named "New" will conflict with the add new organization and add new project functions.

@seav seav changed the title A user with the username 'add' will conflict with the add org member function An organization or a project with the slug 'new' or a user with the username 'add' will conflict with the add functions Jun 30, 2016
@oliverroick
Copy link
Member

There are three ways we can solve this:

  1. Change the URL pattern from /organizations/{slug}/projects/new/ to something like /organizations/{slug}/create-project/
  2. Make sure you can't use new or add as a name for projects or users.
  3. If we want to allow new or add as names (seriously, who does that?) we can make sure the corresponding slug is automatically changed to something different, e.g. project-new. That works for organization and project slugs, but it's not a very nice solution for usernames.

@seav
Copy link
Contributor Author

seav commented Jun 30, 2016

I prefer solution № 1.

@wonderchook
Copy link
Contributor

I think number 2 is the most simple answer at this point and what we should do.

@seav
Copy link
Contributor Author

seav commented Jul 1, 2016

Is this decided? We can modify the forms and serializers to validate that the slug or username is never 'add' nor 'new'.

@wonderchook
Copy link
Contributor

Yes it is decided. We should do the validation for now.

seav added a commit that referenced this issue Jul 5, 2016
seav added a commit that referenced this issue Jul 5, 2016
seav added a commit that referenced this issue Jul 5, 2016
oliverroick added a commit that referenced this issue Jul 6, 2016
clash99 pushed a commit that referenced this issue Jul 6, 2016
Form error changes

Fix #285

Organization page titles

New project wizard page titles

Project area titles work

Resources title - removed project titles

Resources & Map page title

Add relationships and resources to location titles

Change title to test tests

Page title changes

Project dashboard title - remove duplicate

Add records API URL unit tests

Update small table

Add support for conditional attributes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants