Skip to content

Commit 47ab448

Browse files
authored
Merge pull request #2443 from DMPRoadmap/bug/role_perms
fix permissions bug for Notes#update and Roles#deactivate
2 parents 003431d + 497cd8a commit 47ab448

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

app/policies/note_policy.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def create?
1313
end
1414

1515
def update?
16-
Plan.find(@note.answer.plan_id).commentable_by?(@user.id) && @note.user_id = @user.id
16+
Plan.find(@note.answer.plan_id).commentable_by?(@user.id) && @note.user_id == @user.id
1717
end
1818

1919
def archive?

app/policies/role_policy.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ def destroy?
2121
end
2222

2323
def deactivate?
24-
@role.user_id = @user.id
24+
@role.user_id == @user.id
2525
end
26-
end
26+
end

0 commit comments

Comments
 (0)