Refactor User custom roles ability check and preloader
What does this MR do and why?
It fefactors User custom roles ability check and Preloader query.
- it replaces
read_code_for?
andread_vulnerability_for?
methods with one general method that can be used for any project-related permission check - it makes the preloader query more general by getting all customizable permissions and adding them to the query
- it also refactors
ProjetPolicy
specs related to custom roles
This will simplify not only the code but also new custom role abilities implementation.
Database
The query does not change at all. Only the way it is built was changed.
How to set up and validate locally
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Jarka Košanová