diff options
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? } |