Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-10-21 10:08:36 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-10-21 10:08:36 +0300
commit48aff82709769b098321c738f3444b9bdaa694c6 (patch)
treee00c7c43e2d9b603a5a6af576b1685e400410dee /doc/development/policies.md
parent879f5329ee916a948223f8f43d77fba4da6cd028 (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.md10
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
```