role_based_authorization 0.1.9 → 0.1.10
Sign up to get free protection for your applications and to get access to all the features.
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.10
|
@@ -197,11 +197,14 @@ module RoleBasedAuthorization
|
|
197
197
|
# if_authorized?( edit_item_path ) { |opts| link_to('yyy', opts) }
|
198
198
|
|
199
199
|
def if_authorized? opts, &block
|
200
|
+
cleanup_url_regexp = %r{(\Ahttps?://[^/]*(#{ActionController::Base.relative_url_root})?)}
|
201
|
+
|
200
202
|
url_options = nil
|
201
203
|
if opts.class == String
|
202
204
|
path = opts
|
203
205
|
|
204
|
-
|
206
|
+
|
207
|
+
url_options = ActionController::Routing::Routes.recognize_path(path.gsub(cleanup_url_regexp,''))
|
205
208
|
else
|
206
209
|
url_options = opts.dup
|
207
210
|
end
|