Give All Users Access to a Resource #1150
Unanswered
snasphysicist
asked this question in
Q&A
Replies: 1 comment 1 reply
-
I would make 2 checks. One for a user, another on keto check Permission:public view File SomeFile
keto check User:AliceUUID view File SomeFile 1st check can be cached +-forever and be very fast. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am wondering, what is the idiomatic/standard way to allow access to a certain resource to all users? For example, building on https://www.ory.sh/docs/keto/guides/userset-rewrites, suppose we want
File
keto/README.md
to be accessible to any user (i.e. if we query relationview
forFile
keto/README.md
, we will getallowed: true
for anysubject_id
orsubject_set
value). How should that be achieved?I couldn't find any resources at all which suggest how to do this with the Google Zanzibar approach from a quick-ish Google.
I thought of the following approaches, which I don't think are actually a good idea or are not supported.
Assign the
viewers
permission for aUser
namedpublic
, then add checks likethis.related.viewers.includes("public")
- this is explicitly disallowed by the OPL specification (we can only put.includes(ctx.subject)
.Add a
Publics
namespace, then add arelated
for these likerelated: { publicviewers: Public[] }
and add checks likethis.related.publicviewers.traverse((p) => p.permits.permit(ctx))
, and in thePublics
a permit something likepermits: { permit: (ctx: Context): boolean => true}
- this is not very scalable, adds a lot of boilerplate, and is allowed explicitly disallowed by the OPL specificationTo be clear, I would like this to be able to work for both logged in users (who have a unique subject field) and not-logged-in users (who have a default or empty subject field).
So I'm at a bit of a loss - I don't see a clear way to achieve this relationally.
Thanks in advance for any help!
Beta Was this translation helpful? Give feedback.
All reactions