use of org.olat.modules.qpool.model.PoolImpl in project OpenOLAT by OpenOLAT.
the class PoolsAdminController method doManageOwners.
private void doManageOwners(UserRequest ureq, Pool pool) {
if (pool instanceof PoolImpl) {
PoolImpl poolImpl = (PoolImpl) pool;
groupCtrl = new GroupController(ureq, getWindowControl(), true, true, false, true, false, false, poolImpl.getOwnerGroup());
groupCtrl.setUserObject(pool);
listenTo(groupCtrl);
cmc = new CloseableModalController(getWindowControl(), translate("close"), groupCtrl.getInitialComponent(), true, translate("pool.owners"));
cmc.activate();
listenTo(cmc);
}
}
use of org.olat.modules.qpool.model.PoolImpl in project openolat by klemens.
the class QuestionPoolServiceImpl method removeOwners.
@Override
public void removeOwners(List<Identity> owners, List<Pool> pools) {
if (owners == null || owners.isEmpty() || pools == null || pools.isEmpty()) {
// nothing to do
return;
}
List<SecurityGroup> secGroups = new ArrayList<SecurityGroup>(pools.size());
for (Pool pool : pools) {
SecurityGroup secGroup = ((PoolImpl) pool).getOwnerGroup();
secGroups.add(secGroup);
}
securityManager.removeIdentityFromSecurityGroups(owners, secGroups);
}
use of org.olat.modules.qpool.model.PoolImpl in project openolat by klemens.
the class PoolDAO method createPool.
public PoolImpl createPool(Identity owner, String name, boolean publicPool) {
PoolImpl pool = new PoolImpl();
pool.setCreationDate(new Date());
pool.setLastModified(new Date());
pool.setName(name);
pool.setPublicPool(publicPool);
SecurityGroup ownerGroup = securityManager.createAndPersistSecurityGroup();
pool.setOwnerGroup(ownerGroup);
dbInstance.getCurrentEntityManager().persist(pool);
if (owner != null) {
securityManager.addIdentityToSecurityGroup(owner, ownerGroup);
}
return pool;
}
Aggregations