Skip to content

Add generator for custom ability yaml files

Jarka Košanová requested to merge introduce-custom-permission-generators into master

What does this MR do and why?

This is the first MR to simplify the implementation of new custom roles abilities. It introduces a generator that can be used to create yaml files that define all abilities available for the custom roles feature.

The code is based on audit-event-type generator and I created a follow-up issue to refactor the code.

This MR:

  • adds the generator
  • adds YAML files for existing abilities
  • adds schema definition file

Follow-up MRs

  • use the yaml files instead of constants in MemberRole class
  • generate migration needed for adding a new custom role and a request spec
  • generate documentation
  • validate schema & documentation before push

See !137291 (closed) for more context (I split the MR to make the changes smaller).

How to set up and validate locally

interactively: ./bin/custom-ability ability_name, eg. ./bin/custom-ability admin_merge_request

or with arguments:

./bin/custom-ability -d "description." -c feature_category -g -p -i "https://TODO" -m "https:/TODO" ability_name

eg. ./bin/custom-ability -d "Allows read-only access to the vulnerability reports.." -c vulnerability_management -g -p -i "https://TODO" -m "https:/TODO" read_vulnerability

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Jarka Košanová

Merge request reports