ae_declarative_authorization 0.12.1 → 0.13.0.rc1

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: 719562dc167a376019c1cbf5ef98fd3156bbd0420345b49499fb4e2932f7760b
4
- data.tar.gz: 5e730141340ca6205f1c43616c0e4585fb203d3f992848911a778433c01b7da9
3
+ metadata.gz: ad3ef30f4d813634f2a7860abb0a4997327721a6e44a84e968ccadd947ed8eef
4
+ data.tar.gz: 16fb83330aa6bc86d81db1f2386b8e67be4a474a37779e43e520bd99d932b0cc
5
5
  SHA512:
6
- metadata.gz: 954e5d140855c4db4c1be63431e64357bcb1c2a3cdf54fd36bd2ecdd3b45bbf75315da5ca6762af8cab7d6cb582831f5b57e0e57d87e7b9bb05ebbf4c065017c
7
- data.tar.gz: 15132703089d3c1b7c84a474dbf5d3445c21d41580e128c7120bc6a6a3ae184a5c2945b397417463a3c4190ad17453dca442e8c37d93685629179c879cbc7d9c
6
+ metadata.gz: 89a71106a13ee9372778dd77068794e7c25d583ab3aedc51dc912d64e9fe8edc513fd7bd615b17b5c0735d3232ab8db8455f6e55bd4dc310608c994dbd9ca177
7
+ data.tar.gz: dd2e1a0b8d094b51d8374c6da470a7fde9ed837ca4e5e8f395e56515bfaa3ea9eb151223ca5de54658453013ee8dd304683a7dba64eab8d83b64bfacf80c6b6f
@@ -175,6 +175,9 @@ module Authorization
175
175
 
176
176
  user, roles, privileges = user_roles_privleges_from_options(privilege, options)
177
177
 
178
+ callback = Rails.application.config.try(:ae_declarative_authorization_permit_callback)
179
+ callback.call(controller: options[:controller], privilege: privilege) if callback && options.include?(:controller)
180
+
178
181
  return true if roles.is_a?(Hash) && !(roles.keys & omnipotent_roles).empty?
179
182
 
180
183
  # find a authorization rule that matches for at least one of the roles and
@@ -29,7 +29,8 @@ module Authorization
29
29
  :user => contr.send(:current_user),
30
30
  :object => object,
31
31
  :skip_attribute_test => !@attribute_check,
32
- :context => @context || controller_class(contr).decl_auth_context)
32
+ :context => @context || controller_class(contr).decl_auth_context,
33
+ :controller => contr)
33
34
  end
34
35
 
35
36
  def remove_actions(actions)
@@ -1,3 +1,3 @@
1
1
  module DeclarativeAuthorization
2
- VERSION = '0.12.1'.freeze
2
+ VERSION = '0.13.0.rc1'.freeze
3
3
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ae_declarative_authorization
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.1
4
+ version: 0.13.0.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - AppFolio
8
8
  - Steffen Bartsch
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-08-11 00:00:00.000000000 Z
12
+ date: 2020-11-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: blockenspiel
@@ -88,7 +88,7 @@ homepage: http://github.com/appfolio/ae_declarative_authorization
88
88
  licenses:
89
89
  - MIT
90
90
  metadata: {}
91
- post_install_message:
91
+ post_install_message:
92
92
  rdoc_options: []
93
93
  require_paths:
94
94
  - lib
@@ -99,12 +99,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
99
99
  version: '0'
100
100
  required_rubygems_version: !ruby/object:Gem::Requirement
101
101
  requirements:
102
- - - ">="
102
+ - - ">"
103
103
  - !ruby/object:Gem::Version
104
- version: '0'
104
+ version: 1.3.1
105
105
  requirements: []
106
- rubygems_version: 3.1.4
107
- signing_key:
106
+ rubygems_version: 3.0.3
107
+ signing_key:
108
108
  specification_version: 4
109
109
  summary: ae_declarative_authorization is a Rails gem for maintainable authorization
110
110
  based on readable authorization rules.