-
Notifications
You must be signed in to change notification settings - Fork 69
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
Add a Talks Manager permissions group #21
Comments
Hey! I've been looking into this, and it might be worth rethinking the Staff Permission piece. The permissions for Talk and Session are pretty easy to add to a migration, but "staff" status is a field directly on the User model, and not a permission. My current (not working) approach is to add a proxy model to the User with a custom permission, add that permission to the talk manager group, and then set up a pre_save signal on User to switch the "is_staff" attribute on a user if it sees the custom permission. It's roundabout, but in theory should work. |
The usual source doesn't have a good easy answer. Stack Overflow - Staff based on Group Also, I'm relatively certain that the suggested answers there won't work - although if there was a way to override the "is_staff" model attribute with a dynamic property (via @Property) that checks for a custom permission, that might be more straightforward. Not quite sure how to do that yet. |
There may be a simpler method to achieve this, I think. |
I agree that just manually setting "is_staff" is not a good solution. And I like the idea of avoiding having to create a proxy model. My only addition would be I think the signal handler would need to listen to the m2m_changed signal. I don't know offhand whether the Admin app uses the 'add' method, but using m2m_changed should work either way. From the docs:
Also, I'm not sure how to import the implicit intermediate model, but I have confidence I can figure that one out. I'll give it a shot this week and see what happens. Thanks! |
Create a fixture or migration that creates a new user group for talk managers. This will allow superuser administrators to allow access by other users to manage the talks schedule without giving full superuser status to those users.
This group should have the following permissions:
This group should NOT have:
The text was updated successfully, but these errors were encountered: