Is it possible to reverse an permissions check? #1498
-
Hello! I faced a problem which is trivial at a first glance, but I still didn't find any elegant way of dealing with it. I'll give an example:
From the docs I know that I can inherit permissions from For example, site has 100 sections and moderator has access to just 1 of them. Now to check if user can enter admin site I'm making 1 check for It seems so temptious to have a way of just checking Is it possible to do this check simple by authzed? Or maybe I designed this schema wrong from the very beginning? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi 👋🏻 , in order to be able to check There is also a proposal for a reverse relations that would help making that easier so it's inferred instead of requiring the corresponding writes: #356 |
Beta Was this translation helpful? Give feedback.
-
Hmm, understood! |
Beta Was this translation helpful? Give feedback.
Hi 👋🏻 ,
in order to be able to check
is_site_admin
over asite
for a user that happens to be asection_moderator
you need to provide a way to traverse the graph from asite
, therefore you need arelation section: section
undersite
.There is also a proposal for a reverse relations that would help making that easier so it's inferred instead of requiring the corresponding writes: #356