throw new IllegalArgumentException("Invalid right provided");
}
int highestPriority = right.getPriority();
Permission currentHighestRight = getPermission(rights, right);
for (int iCounter = 0; iCounter < baseRights.size(); iCounter++) {
BaseRight bRight = (BaseRight) baseRights.get(iCounter);
// in-case this right is not assigned, ignore this one
if (isRightPresent(rights, right) == false) {
continue;
}
if (highestPriority > bRight.getPriority()) {
highestPriority = bRight.getPriority();
currentHighestRight = getPermission(rights, bRight);
}
}
return currentHighestRight.isAllowed();
}