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

feat: add error to some of the APIs #1389

Merged
merged 6 commits into from
May 7, 2024
Merged

Conversation

MuZhou233
Copy link
Contributor

@MuZhou233 MuZhou233 commented May 3, 2024

Fix #1369

This issue was paritially fixed by #1371, and this PR contains a fully fix.

  • Add nil check on model before anywhere model["g"]["g"] may be accessed.
  • Public API changed

@casbin-bot
Copy link
Member

@tangyang9464 @JalinWang please review

model/policy.go Outdated Show resolved Hide resolved
rbac_api_with_domains.go Outdated Show resolved Hide resolved
model/policy.go Outdated Show resolved Hide resolved
model/model.go Outdated Show resolved Hide resolved
model/policy.go Outdated Show resolved Hide resolved
model/policy.go Outdated Show resolved Hide resolved
management_api_test.go Show resolved Hide resolved
model/policy.go Show resolved Hide resolved
@hsluoyz hsluoyz changed the title fix: nil pointer panic when calling role related functions with no role definition model feat: add error to some of the functions May 7, 2024
@hsluoyz hsluoyz changed the title feat: add error to some of the functions feat: add error to some of the APIs May 7, 2024
@hsluoyz hsluoyz merged commit 65cce21 into casbin:master May 7, 2024
10 of 11 checks passed
Copy link

github-actions bot commented May 7, 2024

🎉 This PR is included in version 2.89.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

joefitzgerald added a commit to joefitzgerald/casbin-pgx-adapter that referenced this pull request Aug 6, 2024
- this PR changed the public API for GetPolicy and GetGroupingPolicy: casbin/casbin#1389

Signed-off-by: Joe Fitzgerald <joe@wearemomentum.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] nil pointer panic when calling role related functions with no role definition model
3 participants