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

Require admin status in project to add it as a subproject #1503

Merged
merged 6 commits into from
Jul 31, 2015

Conversation

gregmuellegger
Copy link
Contributor

Currently you didn't need to be a admin in the subproject to add it as a
project. That way your project could end up as a subproject in project you
don't know about without you being asked for permission.

That has lead to situations were you added a subproject by accident but were
not able to remove it again from your own project since removing it required
admin permissions on the subproject. This PR removes the "am I admin" on the
subproject when removing it.

I added the django-dynamic-fixture library for easy fixture generation. I know
we already have bambooboy for this in the project. But I have issues with this
library. I will propose something related to that later.

Fixes #1122.
Fixes #1341.

@@ -253,6 +253,9 @@ def sync_supported_versions(self):
verbose_name__in=supported).update(supported=False)
self.versions.filter(verbose_name=LATEST_VERBOSE_NAME).update(supported=True)

def user_is_admin(self, user):
Copy link
Member

Choose a reason for hiding this comment

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

We are trying to unify all this logic in one place, which is in the privacy app. This should be routing that logic through there, at least.

https://github.com/rtfd/readthedocs.org/blob/master/readthedocs/privacy/backend.py#L145-L149

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great, didn't know about that! That's integrated now.

It was previously possible to add subprojects without beeing admin of them. It
should be required to be a admin. Otherwise people end up getting incorporated
into a project without knowing it or beeing asked.

Related to #1122
Also adding tests on removing subprojects
@gregmuellegger gregmuellegger force-pushed the validate-subproject-admin branch from 9e99576 to c9550d7 Compare July 31, 2015 06:50
@gregmuellegger
Copy link
Contributor Author

I rebased on the latest master (which changed all the imports) and integrated feedback.

@ericholscher ericholscher merged commit c9550d7 into master Jul 31, 2015
@gregmuellegger gregmuellegger deleted the validate-subproject-admin branch August 3, 2015 13:56
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.

Cannot delete subproject I can add, but not delete, subprojects I don't own
2 participants