Skip to content

implicit policies #1115

Answered by SirMetathyst
SirMetathyst asked this question in Q&A
Sep 30, 2022 · 3 comments · 3 replies
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 3 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

Comment options

You must be logged in to vote
0 replies
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