Skip to content

fix(workflows): allow team admins to update alerts solely connected to their projects - #123385

Merged
malwilley merged 8 commits into
masterfrom
malwilley/project-scoped-workflow-create-v2
Sep 2, 2026
Merged

fix(workflows): allow team admins to update alerts solely connected to their projects#123385
malwilley merged 8 commits into
masterfrom
malwilley/project-scoped-workflow-create-v2

Conversation

@malwilley

Copy link
Copy Markdown
Member

Building on top of other changes in the stack which do the same for the POST and DELETE endpoints.

The goal of all these PRs is to make it possible for team admins (who have the alerts:write scope on the project level, but not on the org-level) to create, edit, and delete workflows which are solely connected to projects they own.

@malwilley
malwilley requested a review from a team as a code owner September 1, 2026 21:31
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Sep 1, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit eac45d0. Configure here.

Determine if the requesting user can edit every workflow in the sequence.

Organization alert writers can delete organization-level workflows. Otherwise,
Organization alert writers can edit any workflow. Otherwise,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might be helpful to include a comment that this includes deletion

Comment on lines +440 to +447
if raw_idlist:
requested_ids = set(to_valid_int_id_list("id", raw_idlist))
if requested_ids != {workflow.id for workflow in workflows}:
raise PermissionDenied

if not can_edit_workflows(workflows, request):
raise PermissionDenied

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering if there's enough common code between this and delete() to make some private helper

@malwilley
malwilley force-pushed the malwilley/project-scoped-workflow-create-v2 branch from eac45d0 to 6248224 Compare September 1, 2026 23:34
@sentry

sentry Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Sentry Snapshot Testing

Name Added Removed Changed Renamed Unchanged Skipped Status
sentry-frontend
sentry-frontend
0 0 0 0 481 0 ✅ Unchanged

⚙️ sentry-frontend Snapshot Settings

Comment thread src/sentry/workflow_engine/endpoints/validators/utils.py Outdated
@malwilley
malwilley force-pushed the malwilley/project-scoped-workflow-create-v2 branch from 6248224 to ef7f7d2 Compare September 2, 2026 17:08
Base automatically changed from malwilley/project-scoped-workflow-create-v1 to master September 2, 2026 18:41
@malwilley
malwilley force-pushed the malwilley/project-scoped-workflow-create-v2 branch from ef7f7d2 to 85df8b7 Compare September 2, 2026 19:59
@linear-code

linear-code Bot commented Sep 2, 2026

Copy link
Copy Markdown

ISWF-3403

…coped-workflow-create-v2

# Conflicts:
#	src/sentry/workflow_engine/endpoints/organization_workflow_index.py
@malwilley
malwilley merged commit b4e5307 into master Sep 2, 2026
65 of 66 checks passed
@malwilley
malwilley deleted the malwilley/project-scoped-workflow-create-v2 branch September 2, 2026 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants