@Override public boolean implies(Permission permission) { if (equals(permission)) { SimpleManagementPermission other = (SimpleManagementPermission) permission; // Validate constraints assert constraints.length == other.constraints.length : String.format("incompatible ManagementPermission; " + "differing constraint counts %d vs %d", constraints.length, other.constraints.length); Action.ActionEffect actionEffect = getActionEffect(); for (int i = 0; i < constraints.length; i++) { Constraint ours = constraints[i]; Constraint theirs = other.constraints[i]; assert ours.getClass() == theirs.getClass() : "incompatible constraints: ours = " + ours.getClass() + " -- theirs = " + theirs.getClass(); if (ours.violates(theirs, actionEffect)) { ControllerLogger.ACCESS_LOGGER.tracef("Constraints are violated for %s", actionEffect); return false; } } return true; } return false; }
@Override public boolean implies(Permission permission) { if (equals(permission)) { SimpleManagementPermission other = (SimpleManagementPermission) permission; // Validate constraints assert constraints.length == other.constraints.length : String.format("incompatible ManagementPermission; " + "differing constraint counts %d vs %d", constraints.length, other.constraints.length); Action.ActionEffect actionEffect = getActionEffect(); for (int i = 0; i < constraints.length; i++) { Constraint ours = constraints[i]; Constraint theirs = other.constraints[i]; assert ours.getClass() == theirs.getClass() : "incompatible constraints: ours = " + ours.getClass() + " -- theirs = " + theirs.getClass(); if (ours.violates(theirs, actionEffect)) { ControllerLogger.ACCESS_LOGGER.tracef("Constraints are violated for %s", actionEffect); return false; } } return true; } return false; }
@Override public boolean implies(Permission permission) { if (equals(permission)) { SimpleManagementPermission other = (SimpleManagementPermission) permission; // Validate constraints assert constraints.length == other.constraints.length : String.format("incompatible ManagementPermission; " + "differing constraint counts %d vs %d", constraints.length, other.constraints.length); Action.ActionEffect actionEffect = getActionEffect(); for (int i = 0; i < constraints.length; i++) { Constraint ours = constraints[i]; Constraint theirs = other.constraints[i]; assert ours.getClass() == theirs.getClass() : "incompatible constraints: ours = " + ours.getClass() + " -- theirs = " + theirs.getClass(); if (ours.violates(theirs, actionEffect)) { ControllerLogger.ACCESS_LOGGER.tracef("Constraints are violated for %s", actionEffect); return false; } } return true; } return false; }