Package org.olat.basesecurity

Examples of org.olat.basesecurity.SecurityGroup


      Tracing.logWarn("A group with this name already exists! You will get null instead of a businessGroup returned!", BusinessGroupFactory.class);
      return null;
    }
    Codepoint.codepoint(BusinessGroupFactory.class, "createAndPersistLearningGroup");
    // groups
    SecurityGroup ownerGroup = securityManager.createAndPersistSecurityGroup();
    SecurityGroup partipiciantGroup = securityManager.createAndPersistSecurityGroup();
    SecurityGroup waitingGroup = securityManager.createAndPersistSecurityGroup();
    //
    businessgroup = new BusinessGroupImpl(BusinessGroup.TYPE_LEARNINGROUP, name, description, ownerGroup, partipiciantGroup, waitingGroup, groupContext);
    businessgroup.setMinParticipants(minParticipants);
    businessgroup.setMaxParticipants(maxParticipants);
    businessgroup.setWaitingListEnabled(waitingListEnabled);
View Full Code Here


      // creating a new group
      return null;
    }

    // group
    SecurityGroup partipiciantGroup = securityManager.createAndPersistSecurityGroup();
    //
    businessgroup = new BusinessGroupImpl(BusinessGroup.TYPE_RIGHTGROUP, name, description, null, partipiciantGroup,null/* no waitingGroup */, groupContext);
    businessgroup.setMinParticipants(minParticipants);
    businessgroup.setMaxParticipants(maxParticipants);
    //
View Full Code Here

   */
  private void doBuddyGroupLeave(UserRequest ureq) {
    Manager securityManager = ManagerFactory.getManager();
    BGConfigFlags flags = BGConfigFlags.createBuddyGroupDefaultFlags();
    // 1) remove as owner
    SecurityGroup owners = currBusinessGroup.getOwnerGroup();
    if (securityManager.isIdentityInSecurityGroup(identity, owners)) {
      List ownerList = securityManager.getIdentitiesOfSecurityGroup(owners);
      if (ownerList.size() > 1) {
        bgm.removeOwnerAndFireEvent(ureq.getIdentity(), ureq.getIdentity(), currBusinessGroup, flags, false);
        // update model
View Full Code Here

    if (userPropertiesSearch.isEmpty()) userPropertiesSearch = null;

    // get group memberships from form
    List<SecurityGroup> groupsList = new ArrayList<SecurityGroup>();
    if (searchform.getCheckBoxElement("admin") != null && searchform.getCheckBoxElement("admin").isChecked()) {
      SecurityGroup group = secMgr.findSecurityGroupByName(org.olat.basesecurity.Constants.GROUP_ADMIN);
      groupsList.add(group);
    }
    if (searchform.getCheckBoxElement("author") != null && searchform.getCheckBoxElement("author").isChecked()) {
      SecurityGroup group = secMgr.findSecurityGroupByName(org.olat.basesecurity.Constants.GROUP_AUTHORS);
      groupsList.add(group);
    }
    if (searchform.getCheckBoxElement("groupmanager") != null && searchform.getCheckBoxElement("groupmanager").isChecked()) {
      SecurityGroup group = secMgr.findSecurityGroupByName(org.olat.basesecurity.Constants.GROUP_GROUPMANAGERS);
      groupsList.add(group);
    }
    if (searchform.getCheckBoxElement("usermanager") != null && searchform.getCheckBoxElement("usermanager").isChecked()) {
      SecurityGroup group = secMgr.findSecurityGroupByName(org.olat.basesecurity.Constants.GROUP_USERMANAGERS);
      groupsList.add(group);
    }
    if (searchform.getCheckBoxElement("oresmanager") != null && searchform.getCheckBoxElement("oresmanager").isChecked()) {
      SecurityGroup group = secMgr.findSecurityGroupByName(org.olat.basesecurity.Constants.GROUP_INST_ORES_MANAGER);
      groupsList.add(group);
    }
    if (searchform.getSingleSelectionElement("status") != null) {
      status = new Integer(searchform.getSingleSelectionElement("status").getSelectedKey());
    }
View Full Code Here

    ContactList ownerCntctLst = new ContactList(businessGroupTranslator.translate("sendtochooser.form.chckbx.owners"));
    ContactList partipCntctLst = new ContactList(businessGroupTranslator.translate("sendtochooser.form.chckbx.partip"));
    ContactList waitingListContactList = new ContactList(businessGroupTranslator.translate("sendtochooser.form.chckbx.waitingList"));
    if (flags.isEnabled(BGConfigFlags.GROUP_OWNERS)) {
      if (sendToChooserForm.ownerChecked().equals(BusinessGroupSendToChooserForm.NLS_RADIO_ALL)) {
        SecurityGroup owners = this.currentGroup.getOwnerGroup();
        List<Identity> ownerList = scrtMngr.getIdentitiesOfSecurityGroup(owners);
        ownerCntctLst.addAllIdentites(ownerList);
        cmsg.addEmailTo(ownerCntctLst);
      } else {
        if (sendToChooserForm.ownerChecked().equals(BusinessGroupSendToChooserForm.NLS_RADIO_CHOOSE)) {
          SecurityGroup owners = this.currentGroup.getOwnerGroup();
          List<Identity> ownerList = scrtMngr.getIdentitiesOfSecurityGroup(owners);
          for (Identity identity : new ArrayList<Identity>(ownerList)) {
            boolean keyIsSelected = false;
            for (Long key : sendToChooserForm.getSelectedOwnerKeys()) {
              if (key.equals(identity.getKey())) {
                keyIsSelected = true;
                break;
              }
            }
            if (!keyIsSelected) {
              ownerList.remove(identity);
            }
          }
          ownerCntctLst.addAllIdentites(ownerList);
          cmsg.addEmailTo(ownerCntctLst);
        }
      }
    }
    if (sendToChooserForm != null) {
      if  (sendToChooserForm.participantChecked().equals(BusinessGroupSendToChooserForm.NLS_RADIO_ALL)) {
        SecurityGroup participants = this.currentGroup.getPartipiciantGroup();
        List<Identity> participantsList = scrtMngr.getIdentitiesOfSecurityGroup(participants);
        partipCntctLst.addAllIdentites(participantsList);
        cmsg.addEmailTo(partipCntctLst);
      } else {
        if (sendToChooserForm.participantChecked().equals(BusinessGroupSendToChooserForm.NLS_RADIO_CHOOSE)) {
          SecurityGroup participants = this.currentGroup.getPartipiciantGroup();
          List<Identity> participantsList = scrtMngr.getIdentitiesOfSecurityGroup(participants);
          for (Identity identity : new ArrayList<Identity>(participantsList)) {
            boolean keyIsSelected = false;
            for (Long key : sendToChooserForm.getSelectedPartipKeys()) {
              if (key.equals(identity.getKey())) {
                keyIsSelected = true;
                break;
              }
            }
            if (!keyIsSelected) {
              participantsList.remove(identity);
            }
          }
          partipCntctLst.addAllIdentites(participantsList);
          cmsg.addEmailTo(partipCntctLst);
        }
      }
     
    }
    if (sendToChooserForm != null && getIsGMAdminOwner(ureq) && this.currentGroup.getWaitingListEnabled().booleanValue()) {
      if (sendToChooserForm.waitingListChecked().equals(BusinessGroupSendToChooserForm.NLS_RADIO_ALL)) {
        SecurityGroup waitingList = this.currentGroup.getWaitingGroup();
        List<Identity> waitingListIdentities = scrtMngr.getIdentitiesOfSecurityGroup(waitingList);
        waitingListContactList.addAllIdentites(waitingListIdentities);
        cmsg.addEmailTo(waitingListContactList);
      } else {
        if (sendToChooserForm.waitingListChecked().equals(BusinessGroupSendToChooserForm.NLS_RADIO_CHOOSE)) {
          SecurityGroup waitingList = this.currentGroup.getWaitingGroup();
          List<Identity> waitingListIdentities = scrtMngr.getIdentitiesOfSecurityGroup(waitingList);
          for (Identity identity : new ArrayList<Identity>(waitingListIdentities)) {
            boolean keyIsSelected = false;
            for (Long key : sendToChooserForm.getSelectedWaitingKeys()) {
              if (key.equals(identity.getKey())) {
View Full Code Here

   
    addLoggingResourceable(LoggingResourceable.wrap(entry, OlatResourceableType.genRepoEntry));
   
    this.repositoryEntry = entry;
       
    SecurityGroup secGroup = repositoryEntry.getOwnerGroup();
    // needed b/c of lazy initialized set
    //DBFactory.getInstance().reputInHibernateSessionCache(secGroup);
    //o_clusterREVIEW
    secGroup = (SecurityGroup) DBFactory.getInstance().loadObject(secGroup);
   
View Full Code Here

   * add owners to a set of repository entries
   */
  private void addOwnersToRepositoryEntry() {
    Manager securityManager = ManagerFactory.getManager();
    for (RepositoryEntry entry : repoEntries) {
      SecurityGroup secGroup = entry.getOwnerGroup();
      for (Identity identity : owners) {
        if (!securityManager.isIdentityInSecurityGroup(identity, secGroup)) {
          securityManager.addIdentityToSecurityGroup(identity, secGroup);
        }
      }
View Full Code Here

    }
   
    OLATResource ores = OLATResourceManager.getInstance().findOrPersistResourceable(newResourceable);
    preparedEntry.setOlatResource(ores);
    // create security group
    SecurityGroup newGroup = securityManager.createAndPersistSecurityGroup();
    // member of this group may modify member's membership
    securityManager.createAndPersistPolicy(newGroup, Constants.PERMISSION_ACCESS, newGroup);
    // members of this group are always authors also
    securityManager.createAndPersistPolicy(newGroup, Constants.PERMISSION_HASROLE, Constants.ORESOURCE_AUTHOR);
   
View Full Code Here

      RepositoryEntry entry = RepositoryManager.getInstance().lookupRepositoryEntry(newEntry.getKey());
      if (entry != null) {
        try {
          Tracing.logDebug("Cleanup : started", RepositoryCopyController.class);
          newEntry = (RepositoryEntry) DBFactory.getInstance().loadObject(newEntry,true);
          SecurityGroup secGroup = newEntry.getOwnerGroup();
          RepositoryHandler repositoryHandler = RepositoryHandlerFactory.getInstance().getRepositoryHandler(newEntry);     
          Tracing.logDebug("Cleanup : repositoryHandler.cleanupOnDelete for olat-resource=" + newEntry.getOlatResource(), RepositoryCopyController.class);
          repositoryHandler.cleanupOnDelete(newEntry.getOlatResource(), null, this.getWindowControl());
          Tracing.logDebug("Cleanup : deleteRepositoryEntry", RepositoryCopyController.class);
          RepositoryManager.getInstance().deleteRepositoryEntry(newEntry);
View Full Code Here

    Roles roles = ureq.getUserSession().getRoles();
   
    vc = new VelocityContainer("reposearch", VELOCITY_ROOT + "/search.html", translator, this);
   
    Manager secMgr = ManagerFactory.getManager();
    SecurityGroup usermanagerGroup = secMgr.findSecurityGroupByName(Constants.GROUP_USERMANAGERS);
    boolean isUserManager = secMgr.isIdentityInSecurityGroup(ureq.getIdentity(), usermanagerGroup);

    searchForm = new SearchForm("searchform", translator, withCancel, isUserManager||roles.isOLATAdmin(), limitType, limitUser);
    searchForm.addListener(this);
    searchForm.setVisible(false);
View Full Code Here

TOP

Related Classes of org.olat.basesecurity.SecurityGroup

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.