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.
Files changed (3) hide show
  1. checksums.yaml +5 -5
  2. data/lib/permissable.rb +2 -2
  3. metadata +6 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: d65265ef614dc684ee34a41fd8edfc51799d5174
4
- data.tar.gz: 86cab6ff914d5950cd44422ece949b09609f6594
2
+ SHA256:
3
+ metadata.gz: 3058047a9ec2d7ee3708efe4ec2a45c4b254dfd01132b642957c6990db6d5bab
4
+ data.tar.gz: 8975667838984bb331d12c8f0811ab802a95bfcdbb062bc6bfb734f4e1dddbda
5
5
  SHA512:
6
- metadata.gz: 457a8e27749b856edb59740ff2bff3069163b825d4a659dcb494cb3e799af37ef8e94362446995b05353836fc255adc2e92d9e4d5db331b77974b565d6bd0b3d
7
- data.tar.gz: 6e4b33c39c624a356b86c142bd86e6575015e75ef2927d837b80104a8de7822685f0933fc55a930b72d5ae9885f42e59ba37eabbe39ba81426d1eca0732d7f0a
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.2
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: 2017-10-03 00:00:00.000000000 Z
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
- rubyforge_project:
85
- rubygems_version: 2.5.2
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: []