Skip to content

Added committee-based permissions #595

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ryantrinh05
Copy link
Contributor

Added a new decorator ( @login_and_committee(committee) ) to create committee based permissions rather than just officer/non-officer permissions. They are now implemented for both the tutoring portal as well as editing the people page.

Also added and changed the current context processor for the templates. Now in addition to checks like "viewer_is_an_officer", django will automatically replace variables such as "viewer_in_bridge" and "viewer_in_tutoring" with the appropriate true/false value. This will be helpful when an element should only be seen by certain groups.

Note that with both the decorator and the context processors, anyone in the exec group will automatically get all of the committee permissions without having to be explicitly added to the group.

To test locally, make sure to add the new groups all lowercase: "act", "bridge", "compserv", "decal", "indrel", "prodev", "serv", "studrel", "tutoring", "csec", "pres", "rsec", "tres", "ivp", "evp", "deprel".

Copy link
Contributor

@508312 508312 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, did not test thoroughly tho.
One suggestion is to add a few unit tests, it just seems from the nature of this task that they won't be too hard too add, and might be quite useful if someone is to dev this feature further
(nobody likes writing tests so not a big deal if there are none >:p)

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

Successfully merging this pull request may close these issues.

2 participants