samples/access_rules.rb in tuersteher-0.3.4 vs samples/access_rules.rb in tuersteher-0.4.0
- old
+ new
@@ -20,24 +20,24 @@
path('/special').grant.extension(:special?, :area1)
#
# Model-Object-Zugriffsregeln
# Aufbau:
-# model(<ModelClass>).grant.permission(<permission>)[.role(<role>)][.extension(<method>[, <expected_value>])]
+# model(<ModelClass>).grant.method(<access-method>)[.role(<role>)][.extension(<method>[, <expected_value>])]
# or
-# model(<ModelClass>).deny.permission(<permission>)[.not][.role(<role>)][.extension(<method>[, <expected_value>])]
+# model(<ModelClass>).deny.method(<access-method>)[.not][.role(<role>)][.extension(<method>[, <expected_value>])]
# or
# model(<ModelClass> do
-# grant..permission(<permission>)[.role(<role>)][.extension(<method>[, <expected_value>])]
-# deny.permission(<permission>)[.role(<role>)][.extension(<method>[, <expected_value>])]
+# grant..method(<access-method>)[.role(<role>)][.extension(<method>[, <expected_value>])]
+# deny.method(<access-method>)[.role(<role>)][.extension(<method>[, <expected_value>])]
# ...
# end
-model(Dashboard).grant.permission(:view)
+model(Dashboard).grant.method(:view)
model(Todo) do
- grant.permission(:view)
- grant.permission(:full_view).role(:ADMIN)
- grant.permission(:update).role(:EDITOR).extension(:owned_by?) # calls Todo.owned_by?(current_user)
- grant-permission(:delete).not.role(:ADMIN)
+ grant.method(:view)
+ grant.method(:full_view).role(:ADMIN)
+ grant.method(:update).role(:EDITOR).extension(:owned_by?) # calls Todo.owned_by?(current_user)
+ grant-method(:delete).not.role(:ADMIN)
end