Add conditional access role options to access tokens view
What does this MR do and why?
Making the access token dropdown in the UI change based on the current user's ability to manage different roles.
- For Maintainers, the dropdown should only show
Guest
,Reporter
,Developer
,Maintainer
- For Owners, the dropdown should also show
Owner
Screenshots or screen recordings
As an owner:
Before
After
As a maintainer:
Before
After
How to set up and validate locally
- As a Maintainer, go to a project's access tokens settings page (e.g.
https://gdk.test:3443/mygroup/myproject/-/settings/access_tokens
)- See the dropdown does not contain
Owner
- See the dropdown does not contain
- As an Owner, view the same page
- See the dropdown contains
Owner
- See the dropdown contains
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Sort of related to #21432 (closed)
Merge request reports
Activity
added devopsmanage + 1 deleted label
assigned to @cablett
Suggested Reviewers (beta)
The individuals below may be good candidates to participate in the review based on various factors.
You can use slash commands in comments to quickly assign
/assign_reviewer @user1
.Suggested Reviewers @jivanvl
,@psimyn
,@wortschi
,@mrincon
,@toon
If you do not believe these suggestions are useful, please apply the label Bad Suggested Reviewer. You can also provide feedback for this feature on this issue:
https://gitlab.com/gitlab-org/gitlab/-/issues/357923
.Automatically generated by Suggested Reviewers Bot - an experimental ML-based recommendation engine created by ~"group::applied ml".
Edited by GitLab Reviewer-Recommender Bot1 Warning featureaddition and featureenhancement merge requests normally have a documentation change. Consider adding a documentation update or confirming the documentation plan with the Technical Writer counterpart.
For more information, see:
- The Handbook page on merge request types.
- The definition of done documentation.
1 Message CHANGELOG missing: If you want to create a changelog entry for GitLab FOSS, add the
Changelog
trailer to the commit message you want to add to the changelog.If you want to create a changelog entry for GitLab EE, also add the
EE: true
trailer to your commit message.If this merge request doesn't need a CHANGELOG entry, feel free to ignore this message.
If needed, you can retry the
danger-review
job that generated this comment.Reviewer roulette
Changes that require review have been detected!
Please refer to the table below for assigning reviewers and maintainers suggested by Danger in the specified category:
Category Reviewer Maintainer backend Tarun Vellishetty ( @tvellishetty
) (UTC+5.5, 6.5 hours behind@cablett
)Alex Kalderimis ( @alexkalderimis
) (UTC-4, 16 hours behind@cablett
)frontend James Rushford ( @jrushford
) (UTC+2, 10 hours behind@cablett
)Vitaly Slobodin ( @vitallium
) (UTC+2, 10 hours behind@cablett
)test Quality for spec/features/*
Andrejs Cunskis ( @acunskis
) (UTC+3, 9 hours behind@cablett
)Maintainer review is optional for test Quality for spec/features/*
To spread load more evenly across eligible reviewers, Danger has picked a candidate for each review slot, based on their timezone. Feel free to override these selections if you think someone else would be better-suited or use the GitLab Review Workload Dashboard to find other available reviewers.
To read more on how to use the reviewer roulette, please take a look at the Engineering workflow and code review guidelines. Please consider assigning a reviewer or maintainer who is a domain expert in the area of the merge request.
Once you've decided who will review this merge request, assign them as a reviewer! Danger does not automatically notify them for you.
Generated by
Dangeradded 1 commit
- b356db21 - Add conditional access role options to access tokens view
- Resolved by 🤖 GitLab Bot 🤖
@cablett - please add typebug typefeature, typemaintenance or a subtype label to this merge request.- typebug: Defects in shipped code and fixes for those defects. This includes all the bug types (availability, performance, security vulnerability, mobile, etc.)
- typefeature: Effort to deliver new features, feature changes & improvements. This includes all changes as part of new product requirements like application limits.
- typemaintenance: Up-keeping efforts & catch-up corrective improvements that are not Features nor Bugs. This includes restructuring for long-term maintainability, stability, reducing technical debt, improving the contributor experience, or upgrading dependencies.
See the handbook for more guidance on classifying.
added featureenhancement typefeature labels
- Resolved by charlie ablett
I've tested this locally and I wanted to write a test for this, but I've just got
diff --git a/spec/features/projects/settings/access_tokens_spec.rb b/spec/features/projects/settings/access_tokens_spec.rb index 4bc543e080a..96ed6e451e7 100644 --- a/spec/features/projects/settings/access_tokens_spec.rb +++ b/spec/features/projects/settings/access_tokens_spec.rb @@ -35,6 +35,18 @@ def create_resource_access_token describe 'token creation' do it_behaves_like 'resource access tokens creation', 'project' + context 'does not show Owner option for a maintainer' do + + it 'allows creation of an access token', :aggregate_failures do + visit resource_settings_access_tokens_path + + dropdown = page.find('.resource_access_token_access_level') + dropdown_options = dropdown.all('[????]', count: 4) + + expect(dropdown_options.map(&:text)).not_to include('Owner') + end + end + context 'when token creation is not allowed' do it_behaves_like 'resource access tokens creation disallowed', 'Project access token creation is disabled in this group. You can still use and manage existing tokens.'
- Resolved by Luke Duncalfe
@manojmj we can do a similar MR for Access Requests accepting view too
@manojmj
, thanks for approving this merge request.This is the first time the merge request is approved. To ensure full test coverage, a new pipeline has been started.
For more info, please refer to the following links:
Allure report
allure-report-publisher
generated test report!review-qa-blocking:
test report for 447b5eceexpand test summary
+---------------------------------------------------------------------------+ | suites summary | +----------------------+--------+--------+---------+-------+-------+--------+ | | passed | failed | skipped | flaky | total | result | +----------------------+--------+--------+---------+-------+-------+--------+ | Manage | 36 | 0 | 2 | 37 | 38 | ❗ | | Create | 23 | 0 | 2 | 22 | 25 | ❗ | | Verify | 12 | 0 | 1 | 12 | 13 | ❗ | | Plan | 48 | 0 | 1 | 48 | 49 | ❗ | | Secure | 6 | 0 | 0 | 6 | 6 | ❗ | | Configure | 0 | 0 | 1 | 0 | 1 | ➖ | | Version sanity check | 0 | 0 | 1 | 0 | 1 | ➖ | | Protect | 2 | 0 | 0 | 2 | 2 | ❗ | | Package | 0 | 0 | 1 | 0 | 1 | ➖ | +----------------------+--------+--------+---------+-------+-------+--------+ | Total | 127 | 0 | 9 | 127 | 136 | ❗ | +----------------------+--------+--------+---------+-------+-------+--------+
mentioned in merge request !88889 (merged)
added sectiondev label
- Resolved by Evan Read
@fneill I think !88889 (merged) covers docs for this MR. WDYT?
cc @eread
mentioned in merge request !89209 (merged)
mentioned in merge request !81393 (merged)
- Resolved by Luke Duncalfe
mentioned in issue gitlab-org/manage/general-discussion#17406
changed milestone to %15.1
- Resolved by Luke Duncalfe
requested review from @abdwdd
- Resolved by charlie ablett
removed review request for @abdwdd
mentioned in issue gitlab-com/www-gitlab-com#13444 (closed)
requested review from @abdwdd
requested review from @fneill
removed review request for @abdwdd
added 1 commit
- f458a305 - Add conditional access role options to access tokens view
requested review from @abdwdd
added 1783 commits
-
f458a305...bcd86544 - 1782 commits from branch
master
- 5c35fac8 - Add conditional access role options to access tokens view
-
f458a305...bcd86544 - 1782 commits from branch
- Resolved by charlie ablett
removed review request for @abdwdd
added 1 commit
- 54a228f3 - Add conditional access role options to access tokens view
- Resolved by Luke Duncalfe
requested review from @.luke
- Resolved by Luke Duncalfe
- Resolved by charlie ablett
- Resolved by charlie ablett
removed review request for @.luke
added 1 commit
- 472d26aa - Add conditional access role options to access tokens view
added 1 commit
- b13b128c - Add conditional access role options to access tokens view
added 226 commits
-
b13b128c...556718bb - 225 commits from branch
master
- 83c1af63 - Add conditional access role options to access tokens view
-
b13b128c...556718bb - 225 commits from branch
added 1 commit
- 417a7db3 - Add conditional access role options to access tokens view
requested review from @.luke
added 1 commit
- 97b1b934 - Add conditional access role options to access tokens view
enabled an automatic merge when the pipeline for 304d47a3 succeeds
added 1 commit
- 08c8136e - Add conditional access role options to access tokens view
enabled an automatic merge when the pipeline for f102e9d8 succeeds
added 1 commit
- 447b5ece - Add conditional access role options to access tokens view
enabled an automatic merge when the pipeline for d0897d28 succeeds
mentioned in commit d51830ba
added workflowstaging-canary label
added workflowcanary label and removed workflowstaging-canary label
added workflowstaging label and removed workflowcanary label
added workflowproduction label and removed workflowstaging label
added releasedpublished label
added releasedcandidate label and removed releasedpublished label
added devopsdata stores grouptenant scale sectioncore platform labels and removed devopsmanage sectiondev + 1 deleted label