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] Domain API not working? #852
Comments
@closetool @tangyang9464 |
@fracartdev After my test, |
@fracartdev Can I have your source code, you said you use the default adapter, but the default adapter could not operate postgresql. |
No,I just test with the file. |
@fracartdev These's a redundant right parenthesis at end of your matcher. |
A typo while I was bringing the code here :) it's not in the source code |
@fracartdev Test with your source code, and it seems everything runs well. func main() {
err := Init()
if err != nil {
panic(err)
}
fmt.Println(Enforcer.Enforce("admin", "domain1", "createCompany", "allow"))
fmt.Println(Enforcer.LoadPolicy())
fmt.Println(Enforcer.Enforce("admin", "domain1", "createCompany", "allow"))
fmt.Println(Enforcer.DeleteDomains("domain1"))
fmt.Println(Enforcer.LoadPolicy())
fmt.Println(Enforcer.Enforce("admin", "domain1", "createCompany", "allow"))
} result is:
|
Closed as resolved. |
Want to prioritize this issue? Try:
What's your scenario? What do you want to achieve?
I'm trying to work on a RBAC with Domains system, I'm using the default configuration from the editor, but all the API commands for the domains don't work. For example,
e.DeleteDomain("domain1")
always returns false (not even an error). I'm storing everything on Postgres and I'm using the default adapter. Everything looks ok on the db table.Your model:
Your policy:
Your request(s):
To have the API to work.
The text was updated successfully, but these errors were encountered: