Replace Write scope with Create and Update in secrets modal
What does this MR do and why?
This MR replaces the Write checkbox with two checkboxes, Create and Update, in the Add user and Add role permissions modal for GitLab Secrets Manager.
- Create: "Can create new secrets."
- Update: "Can update secrets. When unselected, users cannot update any secrets, including secrets they have created."
The new order is Read metadata, Read value, Delete, Create, Update. This matches the design.
Update stays disabled until you select Create. If you clear Create, Update is also cleared.
This is the second and last frontend MR for the work item. The first MR changes the permissions table. The two MRs do not depend on each other. Until the first MR merges, the table still shows "Write" for a Create + Update grant.
The MR also changes these files:
- A Jest spec covers the new rules.
- The QA page object maps
updateto the "Update" label. Six QA end-to-end specs now passcreate updatein place ofwrite. locale/gitlab.potadds the new strings. It removes the unused string "Can create and update secrets."doc/ci/secrets/secrets_manager/_index.mdlists the scopes as read metadata, read value, delete, create, and update. It says that update needs create.
Out of scope: the GraphQL API keeps WRITE. A separate follow-up can change the API if desired.
How the checkboxes map to the API
There is no backend change.- Create alone sends the existing
CREATEaction. This action creates secrets only. It was added in !254325 (merged). - Create + Update sends
CREATEandWRITE. - The backend already drops
createwhenwriteis present. So the result is aWRITEgrant, the same as before. - The Update checkbox keeps the
writedata key in the component. A code comment explains this.
References
- Work item: #630995 (closed)
- Parent epic: gitlab-org#22535
- First frontend MR (permissions table): !260855 (merged)
- Create-only action: !254325 (merged)
Screenshots or screen recordings
How to set up and validate locally
- Use a project with GitLab Secrets Manager enabled.
- Sign in as an Owner. Go to Settings > General > Visibility, project features, permissions. Select Add > Users.
- Check the order of the checkboxes in the modal. Check that Update stays disabled until you select Create. Check that Update clears when you clear Create.
- Grant a Reporter user Read metadata and Create. Sign in as that user and create a secret. This works. Then edit the secret. This is denied with the message "The resource that you are attempting to access does not exist or you don't have permission to perform this action".
- Sign in as the Owner. Grant the same user Read metadata, Create, and Update. Sign in as that user and edit the secret again. This works.
Use a Reporter user, not a Maintainer or Developer. The default role grants also apply to those roles.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.






