-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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 members of "Admin" Team to wipe version envs #3791
Conversation
if request.user not in version.project.users.all(): | ||
# We need to check by ``for_admin_user`` here to allow members of the | ||
# ``Admin`` team (which doesn't own the project) under the corporate site. | ||
if version.project not in Project.objects.for_admin_user(user=request.user): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm changing the logic a bit here since we were checking for "the user belongs to a group" and now I'm checking if "project is under the project which the has admin permissions". Seems to be correct anyway, but just want to mentioned this change on the logic here.
I did manual QA under .com and .org after applying this patch. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good. We should probably check other places that this logic is being used improperly.
@humitos I believe we should be syncing |
I did a grep by
Taking a look at the code of the signal it seems to be right: "all the owners of the organization will be added as owner of the project" which makes sense to me. We could consider adding "all the users in the Admin team of that organization as owner of the project" also. (I'm moving this conversation to a new issue under .com repository: https://github.com/readthedocs/readthedocs-corporate/issues/260) |
I think we can merge this for now to solve a .com issue and continue discussing the best solution on those issues that I opened. |
Fixes https://github.com/readthedocs/readthedocs-corporate/issues/237