auth-lh 0.12.1 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e4b896a96201d30a9dd7727d92af6baa6d8cb53b
4
- data.tar.gz: 5d120319629a6ad50b3196f66a5955d32fe2ebd7
3
+ metadata.gz: 22bd2ce43c5bc8fdbb378dc67ec702c6d8238344
4
+ data.tar.gz: 9aea9637e9a1da011c2976df82aacdf22ddf812a
5
5
  SHA512:
6
- metadata.gz: 7cf7000f7b58d161929ff9fac9d13a96280089e34d025ebc5b3e3f2e144bd25d26689a99ccc06d9a4cd55c3ba33d3346043b7e92290cb9ccbfbc3bc0f71cd6f2
7
- data.tar.gz: 7a5d29749378878f2cd20a4a5c5a3221b57ffd29e5182014852d03ee4d9d0713a901f928bafd6f9b399d828f0d308421e7299a7e54064392abdc5887f0d628cf
6
+ metadata.gz: c40cde2121c358e1eec31079815b791310fa89be8e4421032b6a70f0d0e299180dd0bc968294ad503cd96ae59c34fd8f090e061f2b1daa7921066d68979cbbad
7
+ data.tar.gz: bab243d0fcca65ed793a7af79796f4ffdf383eb370ebd856c5b6911454e15f9babe6496c8888a4911107ffff5267347c0299cfca72e02769e56b976f28c1211e
data/CHANGELOG.md CHANGED
@@ -165,3 +165,7 @@
165
165
  ## v0.12.1
166
166
 
167
167
  * Bugfixes
168
+
169
+ ## v0.13.0
170
+
171
+ * Refactor on authentication module
@@ -1,5 +1,5 @@
1
1
  module Auth
2
2
  module Lh
3
- VERSION = "0.12.1"
3
+ VERSION = "0.13.0"
4
4
  end
5
5
  end
data/lib/auth/lh.rb CHANGED
@@ -1,5 +1,4 @@
1
1
  require 'auth_lh/api'
2
- require 'auth_lh/authentication'
3
2
  require 'auth_lh/external_app'
4
3
  require 'auth_lh/external_app_extended'
5
4
  require 'auth_lh/role'
@@ -8,6 +7,7 @@ require 'auth_lh/session_response'
8
7
  require 'auth_lh/shop'
9
8
  require 'auth_lh/user'
10
9
  require 'auth_lh/user_extended'
10
+ require 'auth_lh/user_management'
11
11
 
12
12
  require 'auth/lh/version'
13
13
 
data/lib/auth_lh/role.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module AuthLh
2
2
  class Role
3
- attr_accessor :code, :name, :position
3
+ attr_accessor :code, :name, :position, :assignable
4
4
 
5
5
  def initialize(attributes={})
6
6
  attributes.each do |k,v|
data/lib/auth_lh/user.rb CHANGED
@@ -15,10 +15,6 @@ module AuthLh
15
15
  end
16
16
  end
17
17
 
18
- def password_expired?
19
- password_expired == true
20
- end
21
-
22
18
  def has_role?(role_code)
23
19
  role_codes.include?(role_code.to_s)
24
20
  end
@@ -1,5 +1,5 @@
1
1
  module AuthLh
2
- module Authentication
2
+ module UserManagement
3
3
  def self.included(base)
4
4
  base.extend(ClassMethods)
5
5
  end
@@ -16,22 +16,6 @@ module AuthLh
16
16
  @auth_user = val
17
17
  end
18
18
 
19
- def has_role?(r_code)
20
- role_codes.include?(r_code.to_s)
21
- end
22
-
23
- def has_some_role?(r_codes)
24
- r_codes.any? { |r_code|
25
- role_codes.include?(r_code.to_s)
26
- }
27
- end
28
-
29
- def has_all_roles?(r_codes)
30
- r_codes.all? { |r_code|
31
- role_codes.include?(r_code.to_s)
32
- }
33
- end
34
-
35
19
  module ClassMethods
36
20
  def all_external
37
21
  @cached_users ||= AuthLh::Api.get_users({ pagination: 'false' })
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: auth-lh
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.1
4
+ version: 0.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matias Hick
@@ -65,7 +65,6 @@ files:
65
65
  - lib/auth/lh.rb
66
66
  - lib/auth/lh/version.rb
67
67
  - lib/auth_lh/api.rb
68
- - lib/auth_lh/authentication.rb
69
68
  - lib/auth_lh/external_app.rb
70
69
  - lib/auth_lh/external_app_extended.rb
71
70
  - lib/auth_lh/role.rb
@@ -74,6 +73,7 @@ files:
74
73
  - lib/auth_lh/shop.rb
75
74
  - lib/auth_lh/user.rb
76
75
  - lib/auth_lh/user_extended.rb
76
+ - lib/auth_lh/user_management.rb
77
77
  homepage: https://github.com/unformattmh/auth-lh
78
78
  licenses:
79
79
  - MIT