Fix webhook warning permission check
What does this MR do and why?
Fix webhook warning permission check
Since we introduced the ability to add the admin_web_hook
permission
to custom roles, we need to specificially check for that permission
(rather than the generic admin_group
permission).
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After |
---|---|
How to set up and validate locally
- Ensure you have an ultimate license applied and your GDK is running in SaaS mode (e.g.
GITLAB_SIMULATE_SAAS=1
) - Enable feature flag:
Feature.enable(: auto_disabling_web_hooks)
- Create a group hook and project hook using an invalid URL (something like
http://example.test
) and set it to trigger for comments) - Add 5 comments to an issue in the group
- Assuming you're logged in as root you should see the disabled webhook warning banner on both the group and project page
- Invite a user to the group with the guest role
- Impersonate the user and confirm you do not see the disabled webhook warning banner on both the group and project page
-
Create a custom role for the group using guest as the base role and including the
Admin web hook
permission - Switch the invited user from guest to your new
guest + web hook admin
role - Impersonate the user and confirm you now see the warnings for the group and project
Edited by Lee Tickett