Loading
Check granular achievement permissions in mutations
What does this MR do and why?
First step of replacing admin_achievement with create_achievement, update_achievement and delete_achievement. Those permissions already exist for token checks, but the user checks still ask for admin_achievement.
- Grants the 3 permissions to maintainer in group scope, next to
admin_achievement, and blocks them on archived groups. - The achievement create, update and delete mutations and their services check the same permission as their token check.
- Moves
allowed?fromAchievements::BaseServiceintoCreateService, its only user.
No one gains or loses access. The controller and UI switch in the next MR, and admin_achievement is removed after that.
References
- https://gitlab.com/gitlab-org/gitlab/-/work_items/565466
- https://gitlab.com/groups/gitlab-org/-/work_items/20207
Screenshots or screen recordings
No UI change.
How to set up and validate locally
bin/rspec spec/graphql/mutations/achievements spec/services/achievements spec/policies/group_policy_spec.rb