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

Why does casbin query the table structure and generate a large number of slow logs? #1112

Closed
jhansin-zhang opened this issue Sep 22, 2022 · 3 comments
Assignees
Labels

Comments

@jhansin-zhang
Copy link

Want to prioritize this issue? Try:

issuehunt-to-marktext
image
How should I optimize it

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

Your model:

[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) && r.obj == p.obj && r.act == p.act

Your policy:

p, alice, data1, read
p, bob, data2, write
p, data2_admin, data2, read
p, data2_admin, data2, write

g, alice, data2_admin

Your request(s):

alice, data2, read ---> false (expected: true)
@casbin-bot
Copy link
Member

@tangyang9464 @JalinWang

@JalinWang
Copy link
Member

JalinWang commented Sep 22, 2022

image

It is a migration SQL generated by gorm-adapter and will only appear when you create this adapter.
If you are affected by it, you can turn off AutoMigrate. Plz refer to: https://github.com/casbin/gorm-adapter#turn-off-automigrate

@jhansin-zhang
Copy link
Author

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants