implicit policies #1115
|
how can I create policies that are applied to all subjects automatically? I thought that casbin was designed to have each subject with its own roles and permission, so that when a user is created, new policies for that user are created to but digging deeper it seems you should only apply policies to specific users you want to have specific perms, like admins, mods etc. so then there must be a way to apply a policy for all subjects implicitly? How can I do this? |
Answered by
SirMetathyst
Sep 30, 2022
Replies: 3 comments 4 replies
|
ok so I figured out how to do it without groups but I'm not sure how to achieve this: to allow user group to all subjects |
0 replies
[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") && r.obj == p.obj && r.act == p.actp, everyone, resource1, read, allow
p, everyone, resource2, read, allow
p, everyone, resource3, read, allow |
3 replies
|
@hsluoyz I think I found something that seems to work. Is there something I've missed? |
1 reply
Answer selected by
SirMetathyst
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@hsluoyz I think I found something that seems to work. Is there something I've missed?