if (roles.isGuestOnly()) throw new OLATSecurityException("Tried to launch a BuddyGroupMainController, but is in guest group " + roles);
return BGControllerFactory.getInstance().createBuddyGroupMainController(ureq, wControl, initialViewIdentifier);
} else if (OresHelper.isOfType(olatResourceable, BusinessGroup.class)) {
if (roles.isGuestOnly()) throw new OLATSecurityException("Tried to launch a BusinessGroup, but is in guest group " + roles);
BusinessGroupManager bgm = BusinessGroupManagerImpl.getInstance();
BusinessGroup bg = bgm.loadBusinessGroup(olatResourceable.getResourceableId(), exceptIfNoneFound);
boolean isOlatAdmin = ureq.getUserSession().getRoles().isOLATAdmin();
// check if allowed to start (must be member or admin)
if (isOlatAdmin || bgm.isIdentityInBusinessGroup(ureq.getIdentity(), bg)) {
// only olatadmins or admins of this group can administer this group
return BGControllerFactory.getInstance().createRunControllerFor(ureq, wControl, bg, isOlatAdmin,
initialViewIdentifier);
}
// else skip