Team admins unable to create or edit alerts
- Dominant language
- Python
- Stars
- 44.8k
- Forks
- 4.9k
- Avg merge
- 21h 10m
- Merged PRs (30d)
- 635
Description
### Environment
SaaS (https://sentry.io/)
### Steps to Reproduce
1. Disable the option "Let Members Create and Edit Alerts"
2. Add a "Member" to a "Team A" as a "Team Admin"
3. Try to create or edit an alert for any project associated with "Team A"
### Expected Result
The member is able to create and/or edit alerts for all projects from Team A
### Actual Result
The action fails with UI message "Unknown error while saving". The network logs shows a 403 response from the "/api/0/organizations/{organization_id_or_slug}/workflows/{workflow_id}/"
This is caused by the option "Let Members Create and Edit Alerts" removing the `alerts:write` scope from members and setting the user as a Team Admin does not add the scope for the specific team.
### Product Area
Alerts
### Link
_No response_
### DSN
_No response_
### Version
_No response_
Contributor guide
Research direction
Start by tracing the permissions handling for the /api/0/organizations/{organization_id_or_slug}/workflows/{workflow_id}/ endpoint and the alerts:write scope when the organization option is disabled. Reproduce the 403 with a Team Admin who is a Member, then verify that Team Admins can create and edit alerts for their team's projects while regular members remain restricted.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, authorization
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 64/100