fix: permission checks for updating or viewing projects in orgs #3776
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.
General Checklist
Database Migrations
The problem
Prior to organizations being introduced, users with
update:project
on projects had permission to add, edit, and deleteDeployTargetConfigs
on projects. The roles that allow this currently aremaintainer
andowner
roles (and higher level roles).After the organizations roll out, the
update:project
permission on the above interactions was changed (probably incorrectly) to only allow organization administrators with theupdateProject:organization
permission to make changes to these configs.Other roles that allow
update:project
still permit users with this permission to perform the same changes they used to do. This includes directly modifying the project settings, adding/removing metadata, and also modifying an environment to use a different deploytarget directly.This permission change is to still allow users that previously had the
update:project
permission to modifyDeployTargetConfigs
to perform these actions, while still allowing organization adminstrators the ability to do so.Modifying
DeployTargetConfigs
of a project in an organization will still require the deploytargets to be available to the organization as before, there is no change to this behaviour.Changes
checkOrgProjectViewPermission
view:project
permission, if not it will check if the project is in an organization or not and will then perform the organization check.view:project
checkOrgProjectUpdatePermission
update:project
permission, if not it will check if the project is in an organization or not and will then perform the organization check.update:project
. It would only checkupdate:project
if the project was not in an organization.