isaca-rails 0.5.0 → 0.5.1

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
  SHA256:
3
- metadata.gz: 90c702697899fa3268bb9f7e7b9520b40fd5d3b7effd2ed3de3b8626cb44bb4d
4
- data.tar.gz: 799f89cdc87027c6330c3cb2a07545e6ea18068bcd7be37661c70afb1774e4bc
3
+ metadata.gz: a754eb45099830e0ead40a91c429439a7d5d914e1037e870b9a7e550e775da78
4
+ data.tar.gz: 045334643d6a5caf2040600186f2767833c6bceb7449286562a7a9b465da6c74
5
5
  SHA512:
6
- metadata.gz: 0a5961e510658f1922bbbe6dba3a0c58a6c83b8f045a6b605b66c36e5f4f17003087861ac58a7928dd892f6379acc930fb7733c8d8c42a57f359aacbe68c7522
7
- data.tar.gz: 1c4efa1deb6a46bec6c88ff47bab3aceca1a19915f5fc33ac4eef6fd194cc1d5df720250a6e4a73480a0abd61cd760faf9749d0731a2da98232cb32a73446044
6
+ metadata.gz: c0b74bc7d53bc7b56eb6eb937596cb20bf20986f0b4c084e709038104aee2f5f646c68cafb1c5758bfa97be190fcca4ed9a63b74a6a56dbb37ce18f8760cb334
7
+ data.tar.gz: cb6f501e6792c203942871a3316d36326a86289507b63d7dc581b9087601507f9639bae747ffe3cea18fabd44186fe6191917f1da94039d3338df84af1ccf4de
@@ -7,8 +7,9 @@ module Isaca
7
7
  helper_method :user_has_privilege?
8
8
  end
9
9
 
10
- def authorize_isaca_user
11
- if current_isaca_user.admin?
10
+ def authorize_isaca_user(user = nil)
11
+ # if current_isaca_user.admin?
12
+ if user.admin?
12
13
  if %w(index new show create update destroy).include?(action_name)
13
14
  if %w(index show).include?(action_name)
14
15
  behavior = 'read'
@@ -24,7 +25,8 @@ module Isaca
24
25
  end
25
26
 
26
27
  privilege = "#{behavior}_#{controller_name.underscore}".to_sym
27
- unless user_has_privilege?(current_isaca_user, privilege)
28
+ # unless user_has_privilege?(current_isaca_user, privilege)
29
+ unless user_has_privilege?(user, privilege)
28
30
  respond_to do |format|
29
31
  message = "#{t('isaca.rails.claims.admin_required')} Missing claim: #{privilege}."
30
32
 
@@ -1,5 +1,5 @@
1
1
  module Isaca
2
2
  module Rails
3
- VERSION = '0.5.0'
3
+ VERSION = '0.5.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isaca-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Orahood
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-09-08 00:00:00.000000000 Z
12
+ date: 2021-09-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails