ae_declarative_authorization 2.4.0 → 2.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ace42195ed830d637916ab21f3680b2cf564568b5dc4a47cde0337d3e29cf138
4
- data.tar.gz: d298ca619546e43f95f4441d42aae0515d1297d4d9225af5e4e5e6fe6568f521
3
+ metadata.gz: 9a4d9886bdee93b119496d3a8bdb11c3808989ccc156b631f29d8affeac6bb45
4
+ data.tar.gz: 1afab5f14ded6ed39acf38236274e8980347272bed46c6cc8eb04697dd045b85
5
5
  SHA512:
6
- metadata.gz: 9127d7d0c38492fc59dca93560fb6d274127b5a9680649dbf0de658ca7b615d307ac5a27e16b76b1d8448c2f12e16281921212ee32647a2bfb5301e2ab1835b8
7
- data.tar.gz: ff6194b8cab88796a50de17efe5123cc814056cbd39f0aff784a5d70c9e0b514ad4d5c4fa454ba5a1d830987a071b86119920968ac1923fd5a2f1b6ca16aa42a
6
+ metadata.gz: 4cbb6c3a9d78567d12f47c52f4cd9afbf42c3f6cc76697d02f928e847107cf0c27dcf3317839ec76c46ab45039e0bb3532589bf89a09882930dd00f34e44ab11
7
+ data.tar.gz: c7fe2d5e8ac10f6f25531eb1d1d3c7f8d4ae306ca4de51bcb0a534451f25873b8a9ebef676fbece34afbb421b1917e60bdd2162b1ac0885d44ab93fff0546654
@@ -39,11 +39,13 @@ module Authorization
39
39
  end
40
40
 
41
41
  def filter_access_filter # :nodoc:
42
- begin
43
- route
44
- rescue
45
- # Acceessing route raises an exception when the response is a 405 MethodNotAllowed
46
- return
42
+ raw = env[::Grape::Env::GRAPE_ALLOWED_METHODS]
43
+ if raw
44
+ allowed_methods = raw.is_a?(Array) ? raw : raw.split(/,\s*/)
45
+ if !allowed_methods.include?(request.request_method)
46
+ header['Allow'] = allowed_methods.join(', ')
47
+ raise ::Grape::Exceptions::MethodNotAllowed.new(header)
48
+ end
47
49
  end
48
50
 
49
51
  action = "#{request.request_method} #{route.origin}"
@@ -1,3 +1,3 @@
1
1
  module DeclarativeAuthorization
2
- VERSION = '2.4.0'.freeze
2
+ VERSION = '2.4.1'.freeze
3
3
  end
@@ -1,7 +1,7 @@
1
1
  require 'rails/generators'
2
2
  module Authorization
3
3
  class InstallGenerator < Rails::Generators::Base
4
-
4
+
5
5
  include Rails::Generators::Migration
6
6
  source_root File.expand_path('../templates', __FILE__)
7
7
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ae_declarative_authorization
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.0
4
+ version: 2.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - AppFolio
@@ -99,7 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
99
99
  - !ruby/object:Gem::Version
100
100
  version: '0'
101
101
  requirements: []
102
- rubygems_version: 4.0.7
102
+ rubygems_version: 4.0.6
103
103
  specification_version: 4
104
104
  summary: Rails gem for maintainable authorization based on readable authorization
105
105
  rules.