On Thu, Nov 3, 2011 at 3:38 AM, Brian <brian.brine...@gmail.com> wrote:
> I have a routes based application where users create "projects", each
> projects has two types of users "administrators" and "users"
>
> I use a route factory to create a project instance as the context of
> most of my views.
>
> I use the built in AuthTktAuthenticationPolicy, inside my callback
> function I add principals, say "group:project_admins"
> "group:project_users" based on the current project.
>
> To do this my authentication policy callback is calling my project
> factory to get the current project to determine the correct principals
> for the context. The project factory is called again by the route to
> generate a context for the view. Really, I want the authentication
> policy callback to vary based on the context of the view, but I'm
> guessing authentication takes place before the routes factory is
> called.

I believe you should have a 'request.context' available in your callback.


-- 
http://danielnouri.org

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-devel" group.
To post to this group, send email to pylons-devel@googlegroups.com.
To unsubscribe from this group, send email to 
pylons-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/pylons-devel?hl=en.

Reply via email to