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

the permission codename is created as "can_view" instead of "view_xxx" #1

Open
johnnydobbins opened this issue Oct 25, 2012 · 0 comments

Comments

@johnnydobbins
Copy link
Member

the permission codename is created as "can_view" instead of "view_xxx" where xxx is the object name.

See how django creates the permission here:
https://github.com/django/django/blob/master/django/contrib/auth/management/__init__.py#L18

The current method of simply having the codename as "can_view" makes using the codename for has_perms unusable.

This should be change to follow the 'django way' of creating permission codenames.

Also need to consider how to update existing codenames.

Example:

| 127 | Can add author                     |              39 | add_author                  |
| 128 | Can change author                  |              39 | change_author               |
| 129 | Can delete author                  |              39 | delete_author               |
| 130 | Can view author                    |              39 | can_view                    |
johnnydobbins pushed a commit to johnnydobbins/django-qourisman that referenced this issue Oct 26, 2012
… format that django uses when creating permissions. Added an initial mirgration that is a data migration to update previously created codename can_view permissions with codename view_[model]. This appears to resolve the issue django-district#1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant