auth-lh 0.10.3 → 0.11.0

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: 30b72f00e8ab8602f4a805770f88e4d5c2581b18
4
- data.tar.gz: b23ffde1ce6aa622e5cdfff168f7c396104b4673
3
+ metadata.gz: f0a76114a78358627330bf6466708047341ea6b1
4
+ data.tar.gz: f1fd2beef57605835ce65342745f4c60f73bc4b6
5
5
  SHA512:
6
- metadata.gz: d8b05bae6bddd22e9f0b5ecc47c473455bb60470b6cf6c1674638e86a15d040ff1a3856d5d69b5bf1fbc95e68a55134ec0647286af7fc0b5c98061149254495a
7
- data.tar.gz: addeec64106d3fcb6a7cb2d0bd1d436870a3779a8bb8bfdcb8cbc2281ae5a1cbb7f334f2dc7a309143de03c7685539f6661bca99de24a752cc326c4a94af4977
6
+ metadata.gz: 79c6376b24006cb03e8611de49f1f92c629ee0628fb8ff2823e5fed2d04441d89992d98bf7e1118995d340212f31670e51593cdede0e9b175fc6f1c36918e593
7
+ data.tar.gz: dd10bd357424085a137a7d6f42b89930276b301f11b4218d0d0525e350242ecfbd5c0f809f8a98ab731a5adbb87b95bdd13b3d2e04e4ab91750ff9bfa8a27249
data/CHANGELOG.md CHANGED
@@ -145,3 +145,7 @@
145
145
  ## v0.10.3
146
146
 
147
147
  * Bugfixed mistyped variable on put request method.
148
+
149
+ ## v0.11.0
150
+
151
+ * Attributes refactor
@@ -1,5 +1,5 @@
1
1
  module Auth
2
2
  module Lh
3
- VERSION = "0.10.3"
3
+ VERSION = "0.11.0"
4
4
  end
5
5
  end
data/lib/auth_lh/role.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module AuthLh
2
2
  class Role
3
- attr_accessor :code, :name, :required_level, :position, :unique_by_shop, :required_shop_code
3
+ attr_accessor :code, :name, :position
4
4
 
5
5
  def initialize(attributes={})
6
6
  attributes.each do |k,v|
data/lib/auth_lh/user.rb CHANGED
@@ -1,8 +1,9 @@
1
1
  module AuthLh
2
2
  class User
3
- attr_accessor :code, :email, :jabber, :name, :login, :shop_code,
4
- :shop_id, :shop_name, :enabled, :role_codes, :password_expired,
5
- :dni, :has_attendance_control, :external_apps, :seller_code
3
+ attr_accessor :email, :jabber, :name, :login, :shop_code,
4
+ :shop_id, :shop_name, :enabled, :role_codes, :password_expired,
5
+ :dni, :has_attendance_control, :has_remote_desktop,
6
+ :fingerprint_from, :fingerprint_to
6
7
 
7
8
  def initialize(attributes={})
8
9
  attributes.each do |k,v|
@@ -21,6 +22,18 @@ module AuthLh
21
22
  def has_role?(role_code)
22
23
  role_codes.include?(role_code.to_s)
23
24
  end
25
+
26
+ def has_some_role?(r_codes)
27
+ r_codes.any? { |r_code|
28
+ role_codes.include?(r_code.to_s)
29
+ }
30
+ end
31
+
32
+ def has_all_roles?(r_codes)
33
+ r_codes.all? { |r_code|
34
+ role_codes.include?(r_code.to_s)
35
+ }
36
+ end
24
37
  end
25
38
  end
26
39
 
@@ -1,10 +1,10 @@
1
1
  module AuthLh
2
2
  class UserExtended
3
- attr_accessor :code, :email, :jabber, :name, :login, :password_digest,
3
+ attr_accessor :email, :jabber, :name, :login, :password_digest,
4
4
  :password_expired, :enabled, :shop_code, :allow_remote_access,
5
- :session_timeout, :access_level, :only_working_time, :birthdate,
6
- :allow_multiple_sessions, :working_time, :dni, :app_codes, :role_codes,
7
- :has_attendance_control, :seller_code
5
+ :session_timeout, :only_working_time, :dni, :allow_multiple_sessions,
6
+ :working_time, :has_attendance_control, :has_remote_desktop,
7
+ :fingerprint_from, :fingerprint_to
8
8
 
9
9
  def initialize(attributes={})
10
10
  attributes.each do |k,v|
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: auth-lh
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.3
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matias Hick
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-09 00:00:00.000000000 Z
11
+ date: 2016-05-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -93,7 +93,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
93
93
  version: '0'
94
94
  requirements: []
95
95
  rubyforge_project:
96
- rubygems_version: 2.2.3
96
+ rubygems_version: 2.2.5
97
97
  signing_key:
98
98
  specification_version: 4
99
99
  summary: Authentication with auth lh api