keycloak-ruby-client 0.0.16 → 0.0.17

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: 64fd5654b140211d2d61816df33711498be7bdc4
4
- data.tar.gz: d263f09209a4a4d27d282ed9c5fa673c9116a0ec
3
+ metadata.gz: e4ad3912988cbe99dc48089b5081e231741f91ff
4
+ data.tar.gz: 934aea6bfdc668da71cd61b558e699062bea6a58
5
5
  SHA512:
6
- metadata.gz: 87621811a0e707edfe779468442738f2044943666a7392e719a1c3511130423c52b91549c7a9c8130ae11fc5454037ad2dceb7faea2a3ab3f6f3076f2c5f3731
7
- data.tar.gz: 062f6231ea0b325c6cac2d603446c93e0fc9e0a2c0176ce2933a208c82e5759a72875f74549e7db73b37fba8d1899d6411d166b7d79f0bbc0d1145bfa8a84ed2
6
+ metadata.gz: 7c098a81780d4a276ae9886ae31bfce0bb5a188bd7e13d46b8f16361430e9b9a5b374cc40afa5fbd7b820e88a992f602123ed7ea4703c40e30f8499d75a04a80
7
+ data.tar.gz: 760a84debe8978adf16a9d26d4ae966c5d9141b7930d4ee463f3b561fd185f29d7d2a827360354bc9f239d14f19989fb12aa32bb5c1edeb3e7267b367e93c7e6
@@ -2,6 +2,8 @@ module Keycloak
2
2
  module UserEntity
3
3
  extend ActiveSupport::Concern
4
4
 
5
+ attr_accessor :keycloak_token
6
+
5
7
  included do
6
8
  def keycloak_client
7
9
  raise NotImplementedError
@@ -20,7 +22,9 @@ module Keycloak
20
22
  end
21
23
 
22
24
  def has_role?(role)
23
- realm_roles.map(&:name).include?(role)
25
+ keycloak_token ?
26
+ keycloak_token.has_role?(role) :
27
+ realm_roles.map(&:name).include?(role)
24
28
  end
25
29
 
26
30
  def _set_or_get_keycloak_data(attr_name, reload)
@@ -1,3 +1,3 @@
1
1
  module Keycloak
2
- VERSION = "0.0.16"
2
+ VERSION = "0.0.17"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: keycloak-ruby-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.16
4
+ version: 0.0.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fuxin Hao