Skip to content

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

Merged
merged 1 commit into from
Sep 2, 2021

Conversation

basakest
Copy link
Contributor

@basakest basakest commented Aug 25, 2021

fix: #30

@hsluoyz
Copy link
Member

hsluoyz commented Aug 27, 2021

@techoner

// ];
// $this->assertEqualsCanonicalizing(Enforcer::getPolicy(), $policies);
}

Copy link
Member

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

Copy link
Contributor Author

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

Copy link
Member

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 ,

@basakest basakest force-pushed the updateFilteredPolicies branch 3 times, most recently from 3834efe to aca58aa Compare September 1, 2021 15:58
feat: support updateFilteredPolicies method

feat: support updateFilteredPolicies method

feat: support updateFilteredPolicies method

feat: support updateFilteredPolicies method
@basakest basakest force-pushed the updateFilteredPolicies branch from aca58aa to 0e1eef3 Compare September 1, 2021 16:31
// ];
// $this->assertEqualsCanonicalizing(Enforcer::getPolicy(), $policies);
}

Copy link
Member

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];
}
Copy link
Member

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");

Copy link
Member

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:

  1. Update all policies of alice
  2. Replace all policies of alice on data
  3. Update all write policies of alice
  4. Update data1, only bob can write
    and many more...

@leeqvip leeqvip merged commit 9676f0b into php-casbin:master Sep 2, 2021
@leeqvip
Copy link
Member

leeqvip commented Sep 2, 2021

🎉 This PR is included in version 2.5.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.

DatabaseAdapter not implement updateFilteredPolicies() method
3 participants