-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Update OwnerActorField usage, refactor RuleSerializer, OpenAPI serializers #106984
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
ceorourke
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Stamping" for the alert rules stuff, will tag an issue-ier person for the group details stuff.
|
|
||
| def test_assign_team_not_member_of_when_open_membership_disabled(self) -> None: | ||
| """ | ||
| Test that a user cannot assign an issue to a team they are not a member of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a change to the current behavior? As a user I'd expect to be able to reassign an issue to a more relevant team if it was mis-assigned. Arbitrarily tapping @roggenkemper to verify
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think open membership being disabled is the important thing to not here - it seems correct that if it is disabled, you can't assign tickets to people from other teams (though if this is true, we should think of a workaround)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, that's a good point. I could revert some of this and we could call out in docs that team re-assignment is very intentional. Then gate that no-membership-reassignment so that only when you're on a team that has been assigned it now, that you can reassign it elsewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@roggenkemper The fix here was to prevent user1 in team1 from reassigning issues to team2 if they are not a member, which is currently possible. Not about assigning to individual members. The cause of some of the current test failures too I'll have to fix.
So what behavior do we want here? Generally speaking, if you're not a member of team2, you shouldn't be able to assign issues to them without team:admin. But if we want to explicitly allow for a not-a-member team assignment of an issue, I can revert and we can better document this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@roggenkemper H'okay, made some changes. A user can now reassign to a team they are not a member of, if its currently assigned to a team they are a member of. They cannot assign an issue to a team they are not a member of if it that object isn't assigned to one of their teams.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might be good to check with someone else but i was under the impression open membership being off meant a user shouldn't be able to see the other teams in their organization, unless they are in it (this assumption could be wrong).
There was a problem hiding this comment.
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 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
wmak
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Issue Assignments GroupValidator.validate_assignedTo was still using ActorField, updated it to use the auth-check'd OwnerActorField to prevent the IDOR.
For the RuleSerializer, refactored its validate_owner for the duplicate auth check that OwnerActorField provides.
Updated the OpenAPI serializer too for docs: