Loading
Use label permissions for label UI checks
What does this MR do and why?
Views and helpers that show label controls still checked admin_label. This MR moves those checks to the specific label permissions, so the UI asks the same question as the controllers and API. Nobody gains or loses access, so the same roles see the same controls.
- "New label" buttons, empty states and the board label dropdown check
create_label. - The priority star, prioritized label drag and the priority empty state check
update_label. The promote option checkspromote_labelon the group. The label actions dropdown checksupdate_label. work_items_helperand the issuable sidebar entity back theircan_admin_labelvalues withcreate_label. Their keys are renamed tocan_create_labelto match. Both only decide whether to show a "Create label" button.
The label actions dropdown always shows edit and delete together. That is fine today because every role that can update a label can also delete it. Splitting it needs a frontend change and is out of scope here.
No changelog, since user-facing behavior does not change.
References
- Related to #566177
- Depends on !257922 (merged)
Screenshots or screen recordings
No UI change. The same roles see the same controls.
How to set up and validate locally
bundle exec rspec spec/helpers/boards_helper_spec.rb ee/spec/helpers/ee/boards_helper_spec.rb spec/helpers/work_items_helper_spec.rb spec/helpers/issuables_helper_spec.rb spec/serializers/issue_sidebar_basic_entity_spec.rb spec/features/projects/labels spec/features/groups/labelsMR 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.
Edited by Diane Russel