Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
Adding decl auth to project ignores custom path separators in routing
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
MattS  
View profile  
 More options Jan 13, 8:02 pm
From: MattS <matt.h...@gmail.com>
Date: Fri, 13 Jan 2012 17:02:35 -0800 (PST)
Local: Fri, Jan 13 2012 8:02 pm
Subject: Adding decl auth to project ignores custom path separators in routing
Hi all,
I'm using Rails 2.3.8 and declarative authorization gem 0.5.3 and ruby
1.9.2

I've been using declarative authorization for a year now and just have
jumped into an existing rails project. I've integrated declarative
authorization into it but it seems to insert itself into the routing
such that it ignores our custom path separators. We have a javascript
heavy UI that makes server calls to a controller with a date range
separated by semicolons, like this:

GET http://localhost:3000//schedule/2012-01-03;2012-01-26

To accommodate this change we simply added this line to the very
beginning of config/routes.rb before the map block

ActionController::Routing::SEPARATORS <<  ";" unless
ActionController::Routing::SEPARATORS.include?(";")

Obviously this adds the semicolon as a path separator.

However as soon as I add the decl auth gem to the project the routing
to the above URL no longer works. Somehow declarative authorization
appears to be expecting slashes instead of using the routing path
separators. Does anyone have any pointers on how to address this. I
didn't see anything like this in the group archives. I'm going to dig
into the gem code to see what is happening.

Any help is greatly appreciated. Thank you.
Matt


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
MattS  
View profile   Translate to Translated (View Original)
 More options Jan 13, 9:38 pm
From: MattS <matt.h...@gmail.com>
Date: Fri, 13 Jan 2012 18:38:40 -0800 (PST)
Local: Fri, Jan 13 2012 9:38 pm
Subject: Re: Adding decl auth to project ignores custom path separators in routing
P.S. We're using this routing directive in the config.rb file, which
uses the semicolon separators

  map.connect 'schedule/:start;:end', :controller =>
'Schedule', :action => 'view'

On Jan 13, 5:02 pm, MattS <matt.h...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
MattS  
View profile  
 More options Jan 14, 7:06 pm
From: MattS <matt.h...@gmail.com>
Date: Sat, 14 Jan 2012 16:06:42 -0800 (PST)
Local: Sat, Jan 14 2012 7:06 pm
Subject: Re: Adding decl auth to project ignores custom path separators in routing

Ok, sort of figured it out. Or at least I have a workaround. I saw that gem
adds its own routes for the rules browser. For some reason drawing those
extra routes in there made the semicolon separated routes not be valid. I
have no idea why. Once I commented out the rules browser paths in that file
everything was ok. Since that's not a sustainable solution, the next thing
I did was to create an initializer file that added the semicolon path
separator like this:

ActionController::Routing::SEPARATORS <<  ";" unless
ActionController::Routing::SEPARATORS.include?(";")

Once I put that code in there in addition to our config/routes.rb then it
worked. I'm still not sure why the decl auth gem adding its own routes
messed up our routing. What's even weirder is that "rake routes" still
showed the routes in there but they weren't being used in the app. Any
insight into this problem would be helpful since I'd like to get to the
root cause of it.

Thank you.
Matt


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »