aclize 0.2.0 → 0.2.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
  SHA1:
3
- metadata.gz: e883bc914bc0302e8ddd301838686b681420ed98
4
- data.tar.gz: 0110271f53cc15fac67b6800f2bbc99de266dfc8
3
+ metadata.gz: 2dc5b30f8e94b4cb8ec3a2aba6f6c3a4a46d3093
4
+ data.tar.gz: 626f6ccc4831edb8101c0d521b49c7b8d35093fe
5
5
  SHA512:
6
- metadata.gz: 74e415381c8b03575c405cec1d54b74b887e3a1aef3e784b6b64e566192e637bf4bdab0c5e692c8f07a7d6903034443f4caab56eb6b054b4a226fb132f874a76
7
- data.tar.gz: 67a452e4826d6450df25ed6cd5bd9272216545a0ce9a62cbecae798676c74bc79c5eb1a5d7fe3d0d1c57d619f08782ad3c31edd8ce81ea791808ca607054611d
6
+ metadata.gz: e0762279bf13cc60194f96cb89b71762f1f6133e8e3f925cdfa5a589513cf622639c73c2d5cf4f1aeab4d40469b1c9e4da22f152aecc24bca386ee7192b70bdc
7
+ data.tar.gz: 30bcfd4450eb78434d230bb05e6811d9300075b833c23291c0f5a05d47228ee64ac5684d9be3cd102aee10d16933e703376fc7709fad45554bd94318e66e05e9
@@ -64,13 +64,14 @@ module Aclize
64
64
  # apply the ACL for a specific role and unauthorize if the user is not permitted
65
65
  # to access controller action or the path
66
66
  def treat_as(role)
67
- acl = @_aclize_acl.get_acl_for(role)
67
+ acl = @_aclize_acl.get_acl_for(role)
68
+ path = request.path.gsub(/^#{relative_url_root}/, '')
68
69
  unauthorize! unless acl
69
70
 
70
- if acl.controllers.permitted?(controller_name, action_name)
71
- unauthorize! if acl.paths.denied?(request.path_info)
71
+ if acl.controllers.permitted?(controller_path, action_name)
72
+ unauthorize! if acl.paths.denied?(path)
72
73
  else
73
- unauthorize! unless acl.paths.permitted?(request.path_info)
74
+ unauthorize! unless acl.paths.permitted?(path)
74
75
  end
75
76
  end
76
77
 
@@ -84,7 +85,7 @@ module Aclize
84
85
  # In no callbacks were defined for unauthorized access, Aclize will render a
85
86
  # default 403 Forbidden page. Otherwise, the control will be passed to the callback.
86
87
  def unauthorize!
87
- path = request.path_info
88
+ path = request.path
88
89
  flash.now[:alert] = I18n.t("aclize.unauthorized", path: path)
89
90
 
90
91
  if @_aclize_callback.nil?
@@ -1,3 +1,3 @@
1
1
  module Aclize
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aclize
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Groza Sergiu