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: pass all policies on effector interface #902

Closed
wants to merge 1 commit into from

Conversation

phoenixsqf
Copy link

Signed-off-by: phoenixsqf sqfphoenix@163.com

Support: #876

Signed-off-by: phoenixsqf <sqfphoenix@163.com>
@casbin-bot
Copy link
Member

@tangyang9464 @closetool @sagilio please review

@@ -655,7 +655,7 @@ func (e *Enforcer) enforce(matcher string, explains *[]string, rvals ...interfac
policyEffects[0] = effector.Indeterminate
}

effect, explainIndex, err = e.eft.MergeEffects(e.model["e"][eType].Value, policyEffects, matcherResults, 0, 1)
effect, explainIndex, err = e.eft.MergeEffects(e.model["e"][eType].Value, policyEffects, matcherResults, 0, nil)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here should be 1. It don't needs to be modified.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tangyang9464 Hello.
I modified effector interface param (policyLength int) -> (policies [][]string). And I could get all policies in effector.
In this condition, the policyLen is 0. It means theres no policy in enforcer.So I think it the policyLen shold be 0 rather than 1.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@phoenixsqf see how Golang implements it.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@hsluoyz hsluoyz closed this Apr 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants