bsm-sso-client 0.7.6 → 0.7.7
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/bsm/sso/client/ability.rb +7 -1
- metadata +1 -1
@@ -55,7 +55,7 @@ module Bsm::Sso::Client::Ability
|
|
55
55
|
end
|
56
56
|
|
57
57
|
same_as(:any)
|
58
|
-
same_as(:administrator) if
|
58
|
+
same_as(:administrator) if administrator?
|
59
59
|
end
|
60
60
|
|
61
61
|
# @return [Symbol] the user scope
|
@@ -75,4 +75,10 @@ module Bsm::Sso::Client::Ability
|
|
75
75
|
send(method) if respond_to?(method, true)
|
76
76
|
end
|
77
77
|
|
78
|
+
private
|
79
|
+
|
80
|
+
def administrator?
|
81
|
+
(@user.respond_to?(:level?) && @user.level.to_i >= 90) || (@user.respond_to?(:admin?) && @user.admin?)
|
82
|
+
end
|
83
|
+
|
78
84
|
end
|