Skip to content

Add `available_from_access_level` property to custom role abilities

What does this MR do and why?

The available_from_access_level property defines the access level from which the ability is available, when applicable.

It is exposed in the GraphQL API on the CustomizablePermissionType.

Issue: #426740 (closed)

Screenshots or screen recordings

Screenshot_2024-01-25_at_21.54.41

How to set up and validate locally

  1. create a new ability by running the following command
    ee/bin/custom-ability new_custom_ability -f -d 'ability description' -c 'ability category' -M '16.9' -m 'https://mr' -i 'https://issue' -g -p -r read_code
  2. restart rails
    gdk restart rails-web
  3. Visit http://localhost:3000/-/graphql-explorer and run the following query:
    query {
      memberRolePermissions {
        nodes {
          name
          availableFromAccessLevel {
            integerValue
            stringValue
          }
        }
      }
    }
  4. Verify the new ability is returned with the correct access level from which it is available
Edited by Alex Buijs

Merge request reports