Add more verification for namespace UserCap availability
What does this MR do and why?
Adds a method to ensure the SaaS User Cap feature is only available for:
- Gitlab.com environment
- groups that have the feature flag specifically enabled for them
Also changes some instances of the Feature.enabled?(:saas_user_caps)
to use the newly added method
Screenshots or screen recordings
These are strongly recommended to assist reviewers and reduce the time to merge your change.
How to set up and validate locally
- Find or create a group
- Enable feature flag for the group
Feature.enable(:saas_user_caps, group)
- Check method:
group.user_cap_available? => false
- Modify Gitlab.com? to return true
- Re-check the method:
group.user_cap_available? => true
- Disable the feature flag
Feature.disable(:saas_user_caps, group)
- Re-check the method:
group.user_cap_available? => false
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 Vijay Hawoldar