Gate cookie banner policy regeneration on its own action

RegenerateCookieBannerTrackerPolicy authorized against the generic
cookie-banner update action, conflating policy regeneration with banner
edits. Add a dedicated regenerate-policy action and authorize both the
console and MCP resolvers against it so the capability can be granted
independently.

Signed-off-by: Émile Ré <emile@probo.com>
This commit is contained in:
Émile Ré
2026-06-09 13:10:19 +02:00
parent ab3750fca4
commit 60a1b1c661
3 changed files with 4 additions and 2 deletions

View File

@@ -779,7 +779,7 @@ func (r *mutationResolver) PublishCookieBannerVersion(ctx context.Context, input
// RegenerateCookieBannerTrackerPolicy is the resolver for the regenerateCookieBannerTrackerPolicy field.
func (r *mutationResolver) RegenerateCookieBannerTrackerPolicy(ctx context.Context, input types.RegenerateCookieBannerTrackerPolicyInput) (*types.RegenerateCookieBannerTrackerPolicyPayload, error) {
scope, err := r.authorize(ctx, input.CookieBannerID, probo.ActionCookieBannerUpdate)
scope, err := r.authorize(ctx, input.CookieBannerID, probo.ActionCookieBannerRegeneratePolicy)
if err != nil {
return nil, err
}