use of org.olat.basesecurity.Grant in project openolat by klemens.
the class BGRightManagerImpl method hasBGRight.
@Override
public boolean hasBGRight(List<BusinessGroup> groups) {
if (groups == null || groups.isEmpty())
return false;
List<Group> secGroups = new ArrayList<>(groups.size());
for (BusinessGroup group : groups) {
secGroups.add(group.getBaseGroup());
}
List<Grant> grants = groupDao.getGrants(secGroups);
// start with bgr.
for (Grant grant : grants) {
String right = grant.getPermission();
if (right.indexOf(BG_RIGHT_PREFIX) == 0) {
return true;
}
}
return false;
}
Aggregations