diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-18 19:00:14 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-18 19:00:14 +0000 |
commit | 05f0ebba3a2c8ddf39e436f412dc2ab5bf1353b2 (patch) | |
tree | 11d0f2a6ec31c7793c184106cedc2ded3d9a2cc5 /app/policies/todo_policy.rb | |
parent | ec73467c23693d0db63a797d10194da9e72a74af (diff) | |
download | gitlab-ce-05f0ebba3a2c8ddf39e436f412dc2ab5bf1353b2.tar.gz |
Add latest changes from gitlab-org/gitlab@15-8-stable-eev15.8.0-rc42
Diffstat (limited to 'app/policies/todo_policy.rb')
-rw-r--r-- | app/policies/todo_policy.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/app/policies/todo_policy.rb b/app/policies/todo_policy.rb index d63eb9407f8..3b4be29664f 100644 --- a/app/policies/todo_policy.rb +++ b/app/policies/todo_policy.rb @@ -11,18 +11,18 @@ class TodoPolicy < BasePolicy @user && @subject.target&.readable_by?(@user) end - desc "Todo has confidential note" - condition(:has_confidential_note, scope: :subject) { @subject&.note&.confidential? } + desc "Todo has internal note" + condition(:has_internal_note, scope: :subject) { @subject&.note&.confidential? } - desc "User can read the todo's confidential note" - condition(:can_read_todo_confidential_note) do + desc "User can read the todo's internal note" + condition(:can_read_todo_internal_note) do @user && @user.can?(:read_internal_note, @subject.target) end rule { own_todo & can_read_target }.enable :read_todo rule { can?(:read_todo) }.enable :update_todo - rule { has_confidential_note & ~can_read_todo_confidential_note }.policy do + rule { has_internal_note & ~can_read_todo_internal_note }.policy do prevent :read_todo prevent :update_todo end |