Hi!

What I need is a possibility to get the list of logged-in user's
principals in my view (so I can e.g. disable 'Edit' link for users not
allowed to edit - pretty common need, I guess).

I could use pyramid.security.effective_principals(request) call, but as
far as I understand this would trigger my authentication policy callback
again! I really want to avoid calling my callback more than once per
request.

My idea is to attach the effective principals list to the request
instance (e.g. as request.effective_principals) before returning from
the callback, so I can later reference it in my view. Are there any
issues I should be careful about here? Or are there better ways to do it?

BR,
Przemyslaw

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

Reply via email to