If a view has a permission set, Pyramid calls the permits() method of your 
security policy.  
https://docs.pylonsproject.org/projects/pyramid/en/latest/api/interfaces.html#pyramid.interfaces.ISecurityPolicy
 
<https://docs.pylonsproject.org/projects/pyramid/en/latest/api/interfaces.html#pyramid.interfaces.ISecurityPolicy>
  (Authorization in Pyramid 1.x)  If permits returns true, Pyramid continues 
the view stack.  If false, an HTTPForbidden error is raised.

So the permission can be any string you want it to be, as long as permits() can 
understand it and give a yes or no.  Pyramid itself doesn’t have any awareness 
of what a permission means, it just passes it on to permits().

I assume you’ve already read the security docs, but if not that’s the place to 
start:  
https://docs.pylonsproject.org/projects/pyramid/en/latest/narr/security.html

— Theron



> On May 9, 2021, at 10:00 AM, pzzcc <grcc...@gmail.com> wrote:
> 
> Hi, 
> 
> I am trying to wrap my head around some pyramid concepts and I am trying to 
> figure out how does a view config know what a permission like ( view , edit , 
> create ) is ?
> 
> does it rely on the pyramid_tm r or the routes or what  ?
> 
> I know how to use them but I need to wrap my head againts some concepts. 
> 
> 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 pylons-discuss+unsubscr...@googlegroups.com 
> <mailto:pylons-discuss+unsubscr...@googlegroups.com>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/pylons-discuss/2b676239-b805-40d6-9ae2-1e4c60a9a7dcn%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/pylons-discuss/2b676239-b805-40d6-9ae2-1e4c60a9a7dcn%40googlegroups.com?utm_medium=email&utm_source=footer>.

-- 
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 pylons-discuss+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pylons-discuss/CAE16496-936A-494F-B70D-611DCD7DAF2C%40luhn.com.

Reply via email to