Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] Handle to handle policy_definition has more than 6 items #212

Closed
longsunli opened this issue May 9, 2023 · 4 comments
Closed

Comments

@longsunli
Copy link

Want to prioritize this issue? Try:

issuehunt-to-marktext


What's your scenario? What do you want to achieve?
Your answer here

Your model:

[request_definition]
r = sub, dom,obj, act

[policy_definition]
p = id, name, status, sub, dom, obj, act, eft, metadata

[role_definition]
g = _, _,_

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

[matchers]
m = g(r.sub, p.sub, r.dom) && p.status == "enable" && keyMatch(r.dom, p.dom) && regexMatch(r.obj, p.obj) && regexMatch(r.act, p.act) 

Your policy:

p,1,name1,enable,Username==Mickey,cats/customer,S1/*,(select)|(insert),allow
p,2,name1,disable,Username==Mickey,cats/customer,S1/*,insert,deny

Your request(s):

alice, data2, read ---> false (expected: true)
Username==Mickey, cats/customer,S1/SHARED_ADDRESS/*,select ---> true (expected: true)
Username==Mickey, cats/customer,S2/SHARED_ADDRESS/*,select ---> false (expected: false)

We are using adapter github.com/casbin/gorm-adapter/v3, but looks like adapter only support v0 to v5
https://github.com/casbin/gorm-adapter/blob/master/adapter.go#L46-L53

Is there any suggestion about this?
Can we extends column numbers or we have to combine policy column?
If we combine them to 6 columns, will have trouble to do the filtering and need to implement some custom functions.

@casbin-bot
Copy link
Member

@tangyang9464 @JalinWang

@PokIsemaine
Copy link
Member

Hi, @longsunli You might consider modifying or writing a new adapter yourself

@hsluoyz hsluoyz transferred this issue from casbin/casbin May 10, 2023
@casbin-bot
Copy link
Member

@hsluoyz
Copy link
Member

hsluoyz commented May 10, 2023

Closed as resolved

@hsluoyz hsluoyz closed this as completed May 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

4 participants