Prevent relevant group policies abilities when its archived
Similar to project's ArchivedAbilities, we'll need an ArchivedAbilities for groups that will contain the abilities and features that we'll prevent when the group is archived. For instance, create_projects should be prevented when the group is archived.
Implementation guide
- Go through the GroupPolicy and understand which abilities and features we should be preventing when the group is archived like we do in the project policy.
- Create a
Group::ArchivedAbilitiesmodule and add the above abilities and features to it and prevent them in the group policy behind thearchive_groupfeature flag. - Use the current
ArchivedAbilitiesto store the common abilities between groups and projects. Also, move the project-specificArchivedAbilitiesto a newProject::ArchivedAbilitiesmodule.
Caution
Make sure to add specs for N+1 queries and monitor these changes using a Kibana dashboard and see if we're introducing any N+1 queries here. You can check for average number of queries used by the endpoints relying on these policies.
Edited by Abdul Wadood