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.
Files changed (2) hide show
  1. data/lib/bsm/sso/client/ability.rb +7 -1
  2. 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 @user.level >= 90
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bsm-sso-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.6
4
+ version: 0.7.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: