Skip to content
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

Allow Wharton Council officers to manage associated clubs #778

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

Conversation

julianweng
Copy link
Member

Enable WC officers to change club settings and provisioned applications for WC clubs, avoiding access issues involving non-WC clubs.

Copy link

codecov bot commented Feb 11, 2025

Codecov Report

Attention: Patch coverage is 68.42105% with 12 lines in your changes missing coverage. Please review.

Project coverage is 73.22%. Comparing base (60af897) to head (7134faf).
Report is 5 commits behind head on master.

Files with missing lines Patch % Lines
backend/clubs/management/commands/sync.py 64.28% 10 Missing ⚠️
backend/clubs/views.py 50.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #778      +/-   ##
==========================================
+ Coverage   72.67%   73.22%   +0.54%     
==========================================
  Files          32       32              
  Lines        7078     7092      +14     
==========================================
+ Hits         5144     5193      +49     
+ Misses       1934     1899      -35     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@aviupadhyayula aviupadhyayula left a comment

Choose a reason for hiding this comment

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

Thanks for taking the initiative on this Julian -- pretty cool way to get around the WC permissions stuff. Left a couple comments.

Also, let's maybe add a views test that ensures that WC officers have edit access over a constituent club?

…atest unapproved versions of clubs akin to club members
@@ -163,6 +163,8 @@ def has_object_permission(self, request, view, obj):
# user must be in club or parent club to perform non-view actions
membership = find_membership_helper(request.user, obj)
Copy link
Member

Choose a reason for hiding this comment

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

Skimming this and memory not the best of the code base... but isn't this already supported? MUSE for example has WC as a parent org and the tree traversal in find_membership_helper should catch this case (are parent orgs synced?)

image

Copy link
Member

@rohangpta rohangpta Feb 17, 2025

Choose a reason for hiding this comment

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

(old PR that came to mind #241)

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for the catch, definitely is supported (sync apparently wasn't a cron: f608990 but that's a separate story) ... will repurpose this PR for the minor change to approved club version viewing and adding a test for the find_membership_helper behavior

@julianweng
Copy link
Member Author

@aviupadhyayula we now sync badges to parent-child relationships on editing badges of a club as discussed: it should ensure consistency as long as 1. badge organizations aren't editable and 2. the badge being edited is a result of a direct parent-child relationship as opposed to an indirect descendant, can you verify if this is true and if so, what kind of workarounds we can implement to support these?

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.

3 participants