permission as a keyword is reserved in view_config and is not a
predicate. You can use the effective_principals predicate however in
such a way as long as you realize that a user may have both principals
and then the view selected is undefined.

On Sat, Dec 6, 2014 at 12:44 PM, Mehdi <[email protected]> wrote:
> Hi
> I wonder is it possible to add permission and effective_principals to view
> predicate?
> This code gives me conflict error:
> @view_config(context=Root,renderer='json',permission='view')
> def root_view(context, request):
>    ...
>
> @view_config(context=Root,renderer='json',permission='admin')
> def root_admin_view(context, request):
>    ...
>
> The main idea is to run different code(view) on the exact same
> context(route) base on the who the user is and which permission does he
> have.
> if I had my user permissions/principals on request.session, would
> add_view_predicate work with 'permission'  or it was reserved?
> Thanks.
>
> --
> You received this message because you are subscribed to the Google Groups
> "pylons-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/pylons-discuss.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/d/optout.

Reply via email to