permissable-coughdrop 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/permissable.rb +2 -2
- metadata +6 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 3058047a9ec2d7ee3708efe4ec2a45c4b254dfd01132b642957c6990db6d5bab
|
4
|
+
data.tar.gz: 8975667838984bb331d12c8f0811ab802a95bfcdbb062bc6bfb734f4e1dddbda
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac4e8f63e8b126bd8e0cde38a6d4e6d5d09cb0a54338130ca6f35dc3c6e12f4cdb20795c97af700c8f77588ed475bea16aed9348267c2a84d45654f28fe403d2
|
7
|
+
data.tar.gz: 3e5200956c566d51b77cf04538a553f72c454cd3369531f77d266b7b05b5eb415bcf30f262abdbdcaa2b2c988b152acfae64f85d0aa013c4f846c46e13d0e857
|
data/lib/permissable.rb
CHANGED
@@ -71,7 +71,7 @@ module Permissable
|
|
71
71
|
def allows?(user, action, relevant_scopes=nil)
|
72
72
|
relevant_scopes ||= user.permission_scopes if user && user.respond_to?(:permission_scopes)
|
73
73
|
relevant_scopes ||= self.class.default_permission_scopes
|
74
|
-
relevant_scopes += ['*']
|
74
|
+
relevant_scopes += ['*'] unless relevant_scopes == ['none']
|
75
75
|
if self.class.allow_cached_permissions
|
76
76
|
# check for an existing result keyed off the record's id and updated_at
|
77
77
|
permissions = permissions_for(user, relevant_scopes)
|
@@ -100,7 +100,7 @@ module Permissable
|
|
100
100
|
def permissions_for(user, relevant_scopes=nil)
|
101
101
|
relevant_scopes ||= user.permission_scopes if user && user.respond_to?(:permission_scopes)
|
102
102
|
relevant_scopes ||= self.class.default_permission_scopes
|
103
|
-
relevant_scopes += ['*']
|
103
|
+
relevant_scopes += ['*'] unless relevant_scopes == ['none']
|
104
104
|
if self.class.allow_cached_permissions
|
105
105
|
cache_key = (user && user.cache_key) || "nobody"
|
106
106
|
cache_key += "/scopes_#{relevant_scopes.join(',')}"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Whitmer
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-06-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -66,7 +66,7 @@ homepage: http://github.com/CoughDrop/permissable
|
|
66
66
|
licenses:
|
67
67
|
- MIT
|
68
68
|
metadata: {}
|
69
|
-
post_install_message:
|
69
|
+
post_install_message:
|
70
70
|
rdoc_options: []
|
71
71
|
require_paths:
|
72
72
|
- lib
|
@@ -81,9 +81,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
requirements: []
|
84
|
-
|
85
|
-
|
86
|
-
signing_key:
|
84
|
+
rubygems_version: 3.0.8
|
85
|
+
signing_key:
|
87
86
|
specification_version: 4
|
88
87
|
summary: Permissable
|
89
88
|
test_files: []
|