diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 10:08:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 10:08:36 +0300 |
commit | 48aff82709769b098321c738f3444b9bdaa694c6 (patch) | |
tree | e00c7c43e2d9b603a5a6af576b1685e400410dee /doc/development/policies.md | |
parent | 879f5329ee916a948223f8f43d77fba4da6cd028 (diff) |
Add latest changes from gitlab-org/gitlab@13-5-stable-eev13.5.0-rc42
Diffstat (limited to 'doc/development/policies.md')
-rw-r--r-- | doc/development/policies.md | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/doc/development/policies.md b/doc/development/policies.md index 8f05948cb41..8dfd4763551 100644 --- a/doc/development/policies.md +++ b/doc/development/policies.md @@ -171,7 +171,7 @@ class ParentPolicy < BasePolicy condition(:speaks_spanish) { @subject.spoken_languages.include?(:es) } condition(:has_license) { @subject.driving_license.present? } condition(:enjoys_broccoli) { @subject.enjoyment_of(:broccoli) > 0 } - + rule { speaks_spanish }.enable :read_spanish rule { has_license }.enable :drive_car rule { enjoys_broccoli }.enable :eat_broccoli @@ -190,7 +190,7 @@ child policy, for example: ```ruby class ChildPolicy < BasePolicy delegate { @subject.parent } - + rule { default }.prevent :drive_car end ``` @@ -211,11 +211,11 @@ The solution it to override the `:eat_broccoli` ability in the child policy: ```ruby class ChildPolicy < BasePolicy delegate { @subject.parent } - + overrides :eat_broccoli - + condition(:good_kid) { @subject.behavior_level >= Child::GOOD } - + rule { good_kid }.enable :eat_broccoli end ``` |