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? from Achievements::BaseService into CreateService, 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

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

Merge request reports

Loading
Loading