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: ABAC support for /api/enforce endpoint #2660

Merged
merged 1 commit into from
Jan 31, 2024

Conversation

lordspinach
Copy link
Contributor

Hello!
Recently i tried to enforce permission with ABAC using 'api/enforce' endpoint. I have model with matchers like this:

m = r.sub.Id == r.obj.CreatedBy

And json body like this:

[
    { "Id": "some-uuid-id" }, 
    { "CreatedBy": "some-uuid-id" },
    "delete"
]

If i got it right, currently this endpoint cannot handle objects in 'sub' or 'obj' so i implement this simple function to fix this

@casbin-bot
Copy link
Contributor

@seriouszyx @ComradeProgrammer please review

@CLAassistant
Copy link

CLAassistant commented Jan 31, 2024

CLA assistant check
All committers have signed the CLA.

@lordspinach lordspinach changed the title ABAC support for /api/enforce endpoint feat: ABAC support for /api/enforce endpoint Jan 31, 2024
@hsluoyz hsluoyz merged commit c409678 into casdoor:master Jan 31, 2024
8 checks passed
@casbin-bot
Copy link
Contributor

🎉 This PR is included in version 1.519.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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.

None yet

4 participants