Added committee-based permissions #595
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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".