Skip to content
Discussion options

You must be logged in to vote

@hsluoyz I think I found something that seems to work. Is there something I've missed?

[request_definition]
r = sub, obj, act

[policy_definition]
p = sub, obj, act

[role_definition]
g = _, _

[policy_effect]
e = some(where (p.eft == allow))

[matchers]
m = (g(r.sub, p.sub) || p.sub == "everyone" || g('everyone', p.sub)) && r.obj == p.obj && r.act == p.act
p, user, data1, read
p, user, data2, read

p, admin, data1, write

g, everyone, user
g, bob, admin
alice, data1, read
alice, data1, write


bob, data1, read
bob, data1, write

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@SirMetathyst
Comment options

@SirMetathyst
Comment options

@hsluoyz
Comment options

hsluoyz Sep 30, 2022
Collaborator

Comment options

You must be logged in to vote
1 reply
@hsluoyz
Comment options

hsluoyz Feb 1, 2026
Collaborator

Answer selected by SirMetathyst
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants