Draft: feat: allow Maintainer role to toggle CI/CD catalog
Relates to issue #583757
Changes
This MR allows maintainers (in addition to owners) to manage CI/CD catalog resources on projects.
Policy Update:
- Moved the
:add_catalog_resourcepermission fromowner_accessrule tomaintainer_accessrule inapp/policies/project_policy.rb - This enables both maintainers and owners to add/manage catalog resources
Test Updates:
- Updated
spec/policies/project_policy_spec.rbto allow maintainers (changedmaintainer | falsetomaintainer | true) - Added maintainer authorization tests to
spec/helpers/ci/catalog/resources_helper_spec.rb - Added maintainer authorization tests to
spec/services/ci/catalog/resources/create_service_spec.rb - Added maintainer authorization tests to
spec/services/ci/catalog/resources/destroy_service_spec.rb - Added maintainer authorization tests to
spec/requests/api/graphql/mutations/ci/catalog/resources/create_spec.rb - Added maintainer authorization tests to
spec/requests/api/graphql/mutations/ci/catalog/resources/destroy_spec.rb
The implementation maintains backward compatibility - owners retain full access while maintainers gain the ability to manage CI/CD catalog resources. The GraphQL mutations and service classes already use the correct :add_catalog_resource ability check, so no changes were needed to those files.
Edited by Timo Furrer