authentic-jwt 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3e6fcda5fe67f9a0e8a4e2831f3d4415ddf32cc9
4
- data.tar.gz: 15d4b595ceec5f589edbdfc83dddecf3e7f3db09
3
+ metadata.gz: b6a959a8396661244a82b062b3c845bdecd37edf
4
+ data.tar.gz: 9beedd0588c44827c8d7836bcad72074c79d47c4
5
5
  SHA512:
6
- metadata.gz: ce798a44e216d19e62d4f4bdf76b447255d7ee4b72c97e1cb6241a384cf9b525f70b79b673930828d25e70634001ebb7e6c378b35e4784aaa5dfdc81113872c5
7
- data.tar.gz: fda56a15d6d0eca70705f4b958010eaad4b5d35dc603e64f55b7f2f3b357f9eeb88622516e2ac7ef651364bb0ae78e4bbae8523beb6c77708b9b524c0f52abf8
6
+ metadata.gz: 97261b6075c5f1de47486b02b7be724bc891fc58e51459b6c94be3d55832826182ee1ccad481fb266613331659c33d69e76555f005907f2c8838978b31835dbf
7
+ data.tar.gz: 4cb551c7fbae0417b48804cd4eacab190132106a9d73d70d6b73a1e61a1602cf19e7b60c79fee25de785f5f3780b9972679a9a1668ec170bf1fca25928135fcf
@@ -17,7 +17,7 @@ module AuthenticJwt
17
17
  raise Forbidden, "No access to account"
18
18
  end
19
19
 
20
- roles = account.roles.collect(&:downcase)
20
+ roles = account.roles.collect(&:to_s).collect(&:downcase)
21
21
 
22
22
  unless roles.any?
23
23
  raise Forbidden, "Account has no roles"
@@ -4,7 +4,7 @@ module AuthenticJwt
4
4
  MAPPING.keys
5
5
  end
6
6
 
7
- def self.mapping
7
+ def self.enum
8
8
  MAPPING
9
9
  end
10
10
 
@@ -21,9 +21,14 @@ module AuthenticJwt
21
21
  READ = ["subscriber"].freeze
22
22
  WRITE = ["contributor", "author", "editor", "partner", "admin", "internal"].freeze
23
23
 
24
- MAPPING = AuthenticJwt::Payload::Role.constants.inject({}) do |memo, const|
25
- memo[const.to_s.downcase] = AuthenticJwt::Payload::Role.const_get(const)
26
- memo
27
- end.freeze
24
+ MAPPING = {
25
+ "subscriber" => 10,
26
+ "contributor" => 20,
27
+ "author" => 30,
28
+ "editor" => 40,
29
+ "partner" => 70,
30
+ "admin" => 80,
31
+ "internal" => 90
32
+ }.freeze
28
33
  end
29
34
  end
@@ -1,3 +1,3 @@
1
1
  module AuthenticJwt
2
- VERSION = "0.0.5".freeze
2
+ VERSION = "0.0.6".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: authentic-jwt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Authentic Limited