-
Notifications
You must be signed in to change notification settings - Fork 68
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
Remove SiteUsers #4683
Remove SiteUsers #4683
Conversation
edb2ed2
to
05451c5
Compare
I could be missing something but it seems like this change (if implemented correctly) won't impact any builds. This returned zero results: notoken = sites.filter(site => site.Organization.OrganizationRoles.every(role => !role.User.githubAccessToken)) |
I should note that I didn't verify the permissions of each token (by calling |
🤖 This is an automated code coverage reportTotal coverage (lines): 16.08% |
cc9b136
to
f527257
Compare
baf98bd
to
5492983
Compare
e6a4e9e
to
60598ad
Compare
We should also update related documentation to make sure people understand that they can no longer add or remove people from individual sites. |
@sknep do you know if our docs say that anywhere? We should update the bottom of https://cloud.gov/pages/documentation/access-permissions/ for inaccuracies but the top describes (correctly) organization access instead of the old method |
afaik, just that section. @Ephraim-G are you any more familiar with our docs? Or will you need to update any ZD macros now that everyone must be added to that site's assigned org to get access? |
60598ad
to
b8fb0d9
Compare
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 well tested and is a much needed cleanup of our user, org, and site model. We've worked through this update a lot and now it looks good to go.
Changes proposed in this pull request:
Build.forSiteUser
andSite.forUser
to only reference organization membership as a condition for viewing Builds/Sites.Organization
model,addRoleUser
for more easily adding users to an organizationget(Site)OrgUsers
toBuild
andSite
for getting users which match the site's organization.createSiteUserOrg
which creates, as needed:user
org
site
belongsSite.users
)async
overPromise
-based testing.Todo:
loadBuildUserAccessToken
and thecreateBuildForWebhookRequest
need a significant rewrite to query organization users rather than site users.Site.users
column) from the database(s)security considerations
This is likely a significant security improvement (removes one access method) but it's also a major change that we should review thoroughly