role_based_authorization 0.1.9 → 0.1.10
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.
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
|