spec/app_root/app/models/power.rb in consul-0.1.2 vs spec/app_root/app/models/power.rb in consul-0.2.0
- old
+ new
@@ -1,9 +1,9 @@
class Power
include Consul::Power
- def initialize(user)
+ def initialize(user = nil)
@user = user
end
power :clients do
Client.active
@@ -15,18 +15,22 @@
power :notes do
Note.scoped(:joins => :client)
end
- power :admin do
+ power :always_true do
+ true
+ end
+
+ power :always_false do
false
end
- power :moderator do
+ power :always_nil do
nil
end
-
- power :dashboard do
- true
+
+ def assignable_user_roles
+ %w[guest admin]
end
end