use of org.olat.basesecurity.GroupRoles in project OpenOLAT by OpenOLAT.
the class BGRightManagerImpl method findBGRights.
/**
* @see org.olat.group.right.BGRightManager#findBGRights(org.olat.group.BusinessGroup)
*/
@Override
public List<String> findBGRights(BusinessGroup group, BGRightsRole role) {
GroupRoles groupRole = null;
if (role == BGRightsRole.tutor) {
groupRole = GroupRoles.coach;
} else if (role == BGRightsRole.participant) {
groupRole = GroupRoles.participant;
} else {
return Collections.emptyList();
}
List<Grant> grants = groupDao.getGrants(group.getBaseGroup(), groupRole.name());
// filter all business group rights permissions. group right permissions
// start with bgr.
List<String> rights = new ArrayList<>();
for (Grant grant : grants) {
String right = grant.getPermission();
if (right.indexOf(BG_RIGHT_PREFIX) == 0) {
rights.add(right);
}
}
return rights;
}
use of org.olat.basesecurity.GroupRoles in project openolat by klemens.
the class BGRightManagerImpl method findBGRights.
/**
* @see org.olat.group.right.BGRightManager#findBGRights(org.olat.group.BusinessGroup)
*/
@Override
public List<String> findBGRights(BusinessGroup group, BGRightsRole role) {
GroupRoles groupRole = null;
if (role == BGRightsRole.tutor) {
groupRole = GroupRoles.coach;
} else if (role == BGRightsRole.participant) {
groupRole = GroupRoles.participant;
} else {
return Collections.emptyList();
}
List<Grant> grants = groupDao.getGrants(group.getBaseGroup(), groupRole.name());
// filter all business group rights permissions. group right permissions
// start with bgr.
List<String> rights = new ArrayList<>();
for (Grant grant : grants) {
String right = grant.getPermission();
if (right.indexOf(BG_RIGHT_PREFIX) == 0) {
rights.add(right);
}
}
return rights;
}
Aggregations