Does the permission actually need to change or can the context object just
return an appropriate ACL based on its state? If you can have the context
object be smarter then problem solved with a single permission. Otherwise
yes you can certainly just handle it imperatively in the view code.

On Thu, Jul 25, 2019 at 8:37 AM Thierry Florac <tflo...@gmail.com> wrote:

> Hi,
> In an application using ZODB traversal, I need to create a view whose
> required permission depends on the state of the "context" object to which
> the view is applied.
> Can I just create an "un-protected" view (without static permission) and
> check the permission in the view initialization code (and raise an
> HTTPForbidden exception if the required permission is missing), or is there
> a more elegant way to handle such a use case?
> Best regards,
> Thierry
> --
>   https://www.ulthar.net -- http://pyams.readthedocs.io
>
> --
> 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/CAPX_VWAChxFOKJrLUs8L%3DRUz6r6u9xQn2fwCFSqZTBA1ehK%2BAQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/pylons-discuss/CAPX_VWAChxFOKJrLUs8L%3DRUz6r6u9xQn2fwCFSqZTBA1ehK%2BAQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>


-- 

Michael

-- 
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/CAKdhhwHTU4H2nKSm7b3j4SNA2T1bG8AT4Yhnx%2BjcQACA_HHb3g%40mail.gmail.com.

Reply via email to