permissable-coughdrop 0.3 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/permissable.rb +2 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb0650034bcbf80a68d5f682d8132c4ab1cd7542
|
4
|
+
data.tar.gz: 468751b4289afc6b6e3233cb05d1501092a808fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a2614551b90baa777eafbba6acda7eb494f68171bb45b8fab4f7c89939e101adf7d53d2b05526e37efab014f45b2b7f5586ae6cba26eac05836324235ebbe2c5
|
7
|
+
data.tar.gz: 61f756401ddd0817c755697909e9bc3e3096bae0b70e4f4d5e1595da5941da3bd6559e2e58ad65031ac7a5d5efb78a71fa2ddd55cf7605a9d1d553c67c0d780d
|
data/lib/permissable.rb
CHANGED
@@ -69,6 +69,7 @@ module Permissable
|
|
69
69
|
end
|
70
70
|
|
71
71
|
def allows?(user, action, relevant_scopes=nil)
|
72
|
+
relevant_scopes ||= user.permission_scopes if user && user.respond_to?(:permission_scopes) && user.permission_scopes.length > 0
|
72
73
|
relevant_scopes ||= self.class.default_permission_scopes
|
73
74
|
relevant_scopes += ['*']
|
74
75
|
if self.class.allow_cached_permissions
|
@@ -97,7 +98,7 @@ module Permissable
|
|
97
98
|
end
|
98
99
|
|
99
100
|
def permissions_for(user, relevant_scopes=nil)
|
100
|
-
relevant_scopes ||=
|
101
|
+
relevant_scopes ||= user.permission_scopes if user && user.respond_to?(:permission_scopes) && user.permission_scopes.length > 0
|
101
102
|
relevant_scopes ||= self.class.default_permission_scopes
|
102
103
|
relevant_scopes += ['*']
|
103
104
|
if self.class.allow_cached_permissions
|