trusty-cms 2.0.24 → 2.0.25
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -3
- data/app/helpers/application_helper.rb +1 -1
- data/coverage/index.html +383 -803
- data/lib/login_system.rb +1 -1
- data/lib/trusty_cms.rb +1 -1
- data/spec/dummy/log/test.log +5202 -0
- data/spec/dummy/tmp/cache/747/A70/TrustyCms%3A%3AConfig +0 -0
- data/spec/dummy/tmp/cache/85C/FA0/TrustyCms.cache_mtime +0 -0
- metadata +2 -2
data/lib/login_system.rb
CHANGED
@@ -120,7 +120,7 @@ module LoginSystem
|
|
120
120
|
case
|
121
121
|
when allowed_roles = permissions[:when]
|
122
122
|
allowed_roles = [allowed_roles].flatten
|
123
|
-
allowed_roles.any? { |role| user.has_role?(role) }
|
123
|
+
user.present? ? allowed_roles.any? { |role| user.has_role?(role) } : false
|
124
124
|
when condition_method = permissions[:if]
|
125
125
|
instance.send(condition_method)
|
126
126
|
else
|