active_element 0.0.5 → 0.0.7
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 67016d55c760a93c399b7d63708d5d8630cb01540c267fd67b1265d36bb79626
|
4
|
+
data.tar.gz: 0177fb6d53c398aaee6dc568035379d4397c4be321c84de76619964e7a9cf325
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22672e0631bf9b14bbed0d44c1d52e975b24b12855bdb2d8b89099007cd248a370054bbae3525a5d83610df510242129c59d3825f0b81ab4ed3db27167c3b9c3
|
7
|
+
data.tar.gz: 6c26e0ae71456eecd781cf0a111be6280c17f3348f5c26039cccd718c9246015cebabba31d093cb00987cf43c67c40a8eba9192893f403d0787b848f4ff4b4b3
|
data/Gemfile.lock
CHANGED
@@ -16,7 +16,7 @@ module ActiveElement
|
|
16
16
|
@active_element ||= ActiveElement::ControllerInterface.new(self.class, self)
|
17
17
|
end
|
18
18
|
|
19
|
-
before_action -> { active_element.
|
19
|
+
before_action -> { active_element.authenticate }
|
20
20
|
before_action -> { ActiveElement::ControllerAction.new(self).process_action }
|
21
21
|
|
22
22
|
helper_method :active_element
|
@@ -13,7 +13,7 @@ module ActiveElement
|
|
13
13
|
Rails.logger.info("#{ActiveElement.log_tag} #{colorized_permissions_message}")
|
14
14
|
return if verified_permissions?
|
15
15
|
|
16
|
-
warn "#{log_tag} #{colorized_permissions_message}" if Rails.env.test?
|
16
|
+
warn "#{ActiveElement.log_tag} #{colorized_permissions_message}" if Rails.env.test?
|
17
17
|
return controller.redirect_to redirect_path if redirect_to_default_landing_page?
|
18
18
|
|
19
19
|
render_forbidden
|
@@ -35,11 +35,14 @@ module ActiveElement
|
|
35
35
|
|
36
36
|
def authorize_with(&block)
|
37
37
|
@authorize = true
|
38
|
-
|
38
|
+
state[:authorizor] = block
|
39
39
|
end
|
40
40
|
|
41
41
|
def authenticate
|
42
42
|
authenticator&.call
|
43
|
+
@current_user = state[:authorizor]&.call
|
44
|
+
|
45
|
+
nil
|
43
46
|
end
|
44
47
|
|
45
48
|
def permit_action(action, with: nil, always: false)
|