Skip to content

Commit

Permalink
Refactor AuthorityChecker (#29645)
Browse files Browse the repository at this point in the history
terrymanu authored Jan 3, 2024
1 parent a635a3c commit 635bad4
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -41,12 +41,12 @@ public final class AuthorityChecker {
*/
public boolean isAuthorized(final ACLObject aclObject) {
if (aclObject instanceof DatabaseACLObject) {
return isAuthorized(((DatabaseACLObject) aclObject).getDatabase());
return isAuthorized((DatabaseACLObject) aclObject);
}
return true;
}

private boolean isAuthorized(final String database) {
return null == grantee || rule.findPrivileges(grantee).map(optional -> optional.hasPrivileges(database)).orElse(false);
private boolean isAuthorized(final DatabaseACLObject aclObject) {
return null == grantee || rule.findPrivileges(grantee).map(optional -> optional.hasPrivileges(aclObject.getDatabase())).orElse(false);
}
}

0 comments on commit 635bad4

Please sign in to comment.