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 +4 -4
- data/lib/isaca/rails/authorization.rb +5 -3
- data/lib/isaca/rails/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a754eb45099830e0ead40a91c429439a7d5d914e1037e870b9a7e550e775da78
|
4
|
+
data.tar.gz: 045334643d6a5caf2040600186f2767833c6bceb7449286562a7a9b465da6c74
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
|
data/lib/isaca/rails/version.rb
CHANGED
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.
|
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-
|
12
|
+
date: 2021-09-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|