fix(opportunity): fix dead creator check in kanban move RBAC
is_owner compared request.profile (a Profile) to opportunity.created_by (a User FK), which is never equal, so a non-admin creator who is not also an assignee was wrongly denied moving their own deal. Compare user ids, matching the detail-view RBAC.
This commit is contained in:
parent
799bb12102
commit
56fe450ab4
1 changed files with 1 additions and 1 deletions
|
|
@ -182,7 +182,7 @@ class OpportunityMoveView(APIView):
|
|||
|
||||
# Match Opportunity update/delete RBAC: admin OR creator OR assignee.
|
||||
if not is_org_admin(request.profile) and not request.user.is_superuser:
|
||||
is_owner = request.profile == opportunity.created_by
|
||||
is_owner = request.profile.user_id == opportunity.created_by_id
|
||||
is_assignee = request.profile in opportunity.assigned_to.all()
|
||||
if not (is_owner or is_assignee):
|
||||
return Response(
|
||||
|
|
|
|||
Loading…
Reference in a new issue