-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Modifications required to implement GitHub SSO in commercial #7183
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
humitos
commented
Jun 17, 2020
If a user delete a repository or if their permissions were removed from that repository, we delete our local RemoteRepository instance tied to that User.
33ece5f
to
c001f07
Compare
humitos
commented
Jun 23, 2020
These methods came from corporate and we are not really using them in community. Now that corporate is implementing SSO, we need to make some modification on them and we can't include them here. We could re-add them once SSO is brought to community or we can implement them in a different class that we can override with our SettingsOverrideObject method.
9ae0f1a
to
abdc017
Compare
With this pattern we can override them from Corporate using the same method we already have, without confusions. Note that .users and .members are exactly the same logic.
abdc017
to
83c42f4
Compare
ericholscher
approved these changes
Jun 23, 2020
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 is a cleaner solution. I'd love to get rid of the model methods entirely, but baby steps 👍
if isinstance(obj, Organization): | ||
return User.objects.filter( | ||
Q(teams__organization=obj) | Q(owner_organizations=obj), | ||
).distinct() |
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 like seeing this logic backported into the .org 👍
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Changes on this PR:
user is part of an organization if there is at least one
Project
imported under thatOrganization
that it's linked to aRemoteRepository
the user owns and the organization hasSSOIntegration
enabledOrganization.members
andOrganization.users
methods were moved toAdminPermission.members
delete
RemoteRepository
instances when syncing GitHub (only those instances that are not tied to aProject
) (Fixes, partially, Deleted repository not detected #2412)