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

  1. 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.
  2. Create a Group::ArchivedAbilities module and add the above abilities and features to it and prevent them in the group policy behind the archive_group feature flag.
  3. Use the current ArchivedAbilities to store the common abilities between groups and projects. Also, move the project-specific ArchivedAbilities to a new Project::ArchivedAbilities module.

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