Skip to content

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