-
Notifications
You must be signed in to change notification settings - Fork 53
feat: support updateFilteredPolicies method #29
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
Conversation
@techoner |
// ]; | ||
// $this->assertEqualsCanonicalizing(Enforcer::getPolicy(), $policies); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it commented out this code? @basakest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method calls some methods in php-casbin, and the pr has not been merged before @techoner
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@basakest It has been merged ,
3834efe
to
aca58aa
Compare
feat: support updateFilteredPolicies method feat: support updateFilteredPolicies method feat: support updateFilteredPolicies method feat: support updateFilteredPolicies method
aca58aa
to
0e1eef3
Compare
// ]; | ||
// $this->assertEqualsCanonicalizing(Enforcer::getPolicy(), $policies); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@basakest It has been merged ,
} | ||
if ($fieldIndex <= 5 && 5 < $fieldIndex + count($fieldValues)) { | ||
$where['v5'] = $fieldValues[5 - $fieldIndex]; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@basakest I think this is not complete enough, empty("" or null) values are not excluded .
|
||
Enforcer::updateFilteredPolicies([["alice", "data1", "write"]], 0, "alice", "data1", "read"); | ||
Enforcer::updateFilteredPolicies([["bob", "data2", "read"]], 0, "bob", "data2", "write"); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test case can be more comprehensive, such as:
- Update all policies of
alice
- Replace all policies of
alice
ondata
- Update all
write
policies ofalice
- Update
data1
, onlybob
canwrite
and many more...
🎉 This PR is included in version 2.5.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
fix: #30