Skip to content

Commit

Permalink
feat: allow RBAC g policy to have more than 4 elements (#350)
Browse files Browse the repository at this point in the history
  • Loading branch information
JuusoL authored Aug 2, 2023
1 parent fa605df commit a13ba2f
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/main/java/org/casbin/jcasbin/model/Assertion.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,7 @@ protected void buildRoleLinks(RoleManager rm) {
if (rule.size() < count) {
throw new IllegalArgumentException("grouping policy elements do not meet role definition");
}

if (count == 2) {
rm.addLink(rule.get(0), rule.get(1));
} else if (count == 3) {
rm.addLink(rule.get(0), rule.get(1), rule.get(2));
} else if (count == 4) {
rm.addLink(rule.get(0), rule.get(1), rule.get(2), rule.get(3));
}
rm.addLink(rule.get(0), rule.get(1), rule.subList(2, rule.size()).toArray(new String[0]));
}

Util.logPrint("Role links for: " + key);
Expand Down

0 comments on commit a13ba2f

Please sign in to comment.