permissable-coughdrop 0.3 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/permissable.rb +2 -1
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7240b08299e2d048b77a0f209e16822178bd2664
4
- data.tar.gz: c7e61cec2e67a0a678fd84e7c89336c3ccdac040
3
+ metadata.gz: eb0650034bcbf80a68d5f682d8132c4ab1cd7542
4
+ data.tar.gz: 468751b4289afc6b6e3233cb05d1501092a808fd
5
5
  SHA512:
6
- metadata.gz: debf9057a29714e326613dd76a6036cb4e48319621ccffc7eca5cf8a2165bcc8f54f038f93f1f4df7c91e9b77885eab39fb29503d38cafe05a23e1282bb19e5a
7
- data.tar.gz: b601d1896dbdc422c7cfcd80509316fd4467113245c972d4e256d70e32ecb00995361f553de27b4df2c60701fa3308832f135089845527eccfea3a300758c05a
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 ||= self.permission_scopes if user && user.respond_to?(:permission_scopes) && user.permission_scopes.length > 0
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: permissable-coughdrop
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.3'
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Whitmer