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 +4 -4
- data/lib/keycloak/user_entity.rb +5 -1
- data/lib/keycloak/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e4ad3912988cbe99dc48089b5081e231741f91ff
|
4
|
+
data.tar.gz: 934aea6bfdc668da71cd61b558e699062bea6a58
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c098a81780d4a276ae9886ae31bfce0bb5a188bd7e13d46b8f16361430e9b9a5b374cc40afa5fbd7b820e88a992f602123ed7ea4703c40e30f8499d75a04a80
|
7
|
+
data.tar.gz: 760a84debe8978adf16a9d26d4ae966c5d9141b7930d4ee463f3b561fd185f29d7d2a827360354bc9f239d14f19989fb12aa32bb5c1edeb3e7267b367e93c7e6
|
data/lib/keycloak/user_entity.rb
CHANGED
@@ -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
|
-
|
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)
|
data/lib/keycloak/version.rb
CHANGED