[cloud][CLOUD-73] Disallow site-admin access to organizations on Cloud
Created by: kopancek
Description
Disallow site-admin to access organizations on Cloud. Only members of the organization will have read-write access to organization settings, to view the organization fields (including name) and to view it's members.
Related items
https://sourcegraph.atlassian.net/browse/CLOUD-73
Screenshots
Testing locally
New behavior on Cloud
- Run sg locally in dotcom mode:
EXTSVC_CONFIG_ALLOW_EDITS=true sg start dotcom
- Login as a site-admin
- Create an organization
- Logout and log in as a different site-admin (not a member of the organization)
- Go to https://sourcegraph.test:3443/site-admin/organizations and verify that you cannot see the list of organizations
- Try to access organization settings by going to https://sourcegraph.test:3443/organizations/PUT_ORG_NAME_HERE/settings and verify that you are shown an error
Old behavior applied when not on cloud
- Run sg locally in enterprise mode:
EXTSVC_CONFIG_ALLOW_EDITS=true sg start enterprise
- Login as a site-admin
- Go to https://sourcegraph.test:3443/site-admin/organizations and verify that you can see the list of all orgs defined on the instance
- Try to access any organization settings that the site-admin is not a member off - this should work
- Try to modify any organization settings that the site-admin is not a member off - this should work
- Try to add a member to the organization directly, without creating an invite - this should work