Skip to content

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
image image
image image

How to set up and validate locally

  1. Ensure you have an ultimate license applied and your GDK is running in SaaS mode (e.g. GITLAB_SIMULATE_SAAS=1)
  2. Enable feature flag: Feature.enable(: auto_disabling_web_hooks)
  3. Create a group hook and project hook using an invalid URL (something like http://example.test) and set it to trigger for comments)
  4. Add 5 comments to an issue in the group
  5. Assuming you're logged in as root you should see the disabled webhook warning banner on both the group and project page
  6. Invite a user to the group with the guest role
  7. Impersonate the user and confirm you do not see the disabled webhook warning banner on both the group and project page
  8. Create a custom role for the group using guest as the base role and including the Admin web hook permission
  9. Switch the invited user from guest to your new guest + web hook admin role
  10. Impersonate the user and confirm you now see the warnings for the group and project
Edited by Lee Tickett

Merge request reports