Custom permissions on proxy model no longer created
|Reported by:||koenb||Owned by:||nobody|
|Severity:||Normal||Keywords:||proxy contenttype permission|
|Has patch:||yes||Needs documentation:||yes|
|Needs tests:||no||Patch needs improvement:||no|
I have been using some specific permissions concerning the auth user model, so I created a proxy model on user like this:
class User(auth_models.User): class Meta: proxy = True permissions = ( ("display_users", "May display users information"), ("edit_users", "May edit users information"), )
In 1.3 these custom permissions were created during syncdb (linked to the auth.User model).
Now I was testing my project with the 1.4 RC, and it turns out those permissions are no longer created.
This is caused by the refactor of the create_permissions code, which now uses get_for_models to determine the class to get the options for, but this returns the proxied class (auth.User), not the proxy class, so my custom permissions are not found and not created.
Change History (9)
comment:1 Changed 2 years ago by ramiro
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
- Triage Stage changed from Unreviewed to Accepted
Changed 2 years ago by claudep
comment:6 Changed 2 years ago by aaugustin
- Has patch unset
- Severity changed from Release blocker to Normal
comment:7 Changed 21 months ago by charettes
- Has patch set
- Keywords proxy contenttype permission added