diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-20 17:34:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-20 17:34:42 +0300 |
commit | 9f46488805e86b1bc341ea1620b866016c2ce5ed (patch) | |
tree | f9748c7e287041e37d6da49e0a29c9511dc34768 /doc/development/policies.md | |
parent | dfc92d081ea0332d69c8aca2f0e745cb48ae5e6d (diff) |
Add latest changes from gitlab-org/gitlab@13-0-stable-ee
Diffstat (limited to 'doc/development/policies.md')
-rw-r--r-- | doc/development/policies.md | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/doc/development/policies.md b/doc/development/policies.md index 4d045411156..62442de825a 100644 --- a/doc/development/policies.md +++ b/doc/development/policies.md @@ -95,7 +95,7 @@ Each line represents a rule that was evaluated. There are a few things to note: Here you can see that the first four rules were evaluated `false` for which user and subject. For example, you can see in the last line that -the rule was activated because the user `root` had Reporter access to +the rule was activated because the user `john` had Reporter access to `Project/4`. When a policy is asked whether a particular ability is allowed @@ -123,7 +123,7 @@ class FooPolicy < BasePolicy end ``` -Naively, if we call `Ability.can?(user1, :some_ability, foo)` and `Ability.can?(user2, :some_ability, foo)`, we would have to calculate the condition twice - since they are for different users. But if we use the `scope: :subject` option: +Naively, if we call `Ability.allowed?(user1, :some_ability, foo)` and `Ability.allowed?(user2, :some_ability, foo)`, we would have to calculate the condition twice - since they are for different users. But if we use the `scope: :subject` option: ```ruby condition(:expensive_condition, scope: :subject) { @subject.expensive_query? } |