Package org.olat.basesecurity

Examples of org.olat.basesecurity.Manager


  /**
   * @see org.olat.course.groupsandrights.CourseGroupManager#getCoachesFromLearningGroups(String)
   */
  public List getCoachesFromLearningGroup(String groupName) {
    Manager secManager = ManagerFactory.getManager();
    List retVal = new ArrayList();
    List bgs = null;
    if (groupName != null) {
      // filtered by name
      bgs = getLearningGroupsFromAllContexts(groupName);
    } else {
      // no filter
      bgs = getAllLearningGroupsFromAllContexts();
    }
    for (int i = 0; i < bgs.size(); i++) {
      // iterates over all business group in the course, fetching the identities
      // of the business groups OWNER
      BusinessGroup elm = (BusinessGroup) bgs.get(i);
      retVal.addAll(secManager.getIdentitiesOfSecurityGroup(elm.getOwnerGroup()));
    }
    return retVal;
  }
View Full Code Here


  /**
   * @see org.olat.course.groupsandrights.CourseGroupManager#getParticipantsFromLearningGroups(String)
   */
  public List getParticipantsFromLearningGroup(String groupName) {
    Manager secManager = ManagerFactory.getManager();
    List retVal = new ArrayList();
    List bgs = null;
    if (groupName != null) {
      // filtered by name
      bgs = getLearningGroupsFromAllContexts(groupName);
    } else {
      // no filter
      bgs = getAllLearningGroupsFromAllContexts();
    }
    for (int i = 0; i < bgs.size(); i++) {
      // iterates over all business group in the course, fetching the identities
      // of the business groups PARTICIPANTS
      BusinessGroup elm = (BusinessGroup) bgs.get(i);
      retVal.addAll(secManager.getIdentitiesOfSecurityGroup(elm.getPartipiciantGroup()));
    }
    return retVal;
  }
View Full Code Here

  /**
   * @see org.olat.course.groupsandrights.CourseGroupManager#getCoachesFromArea(java.lang.String)
   */
  public List getCoachesFromArea(String areaName) {
    Manager secManager = ManagerFactory.getManager();
    List retVal = new ArrayList();
    List bgs = null;
    if (areaName != null) {
      bgs = getLearningGroupsInAreaFromAllContexts(areaName);
    } else {
      bgs = getAllLearningGroupsFromAllContexts();
    }
    for (int i = 0; i < bgs.size(); i++) {
      // iterates over all business group in the course's area, fetching the
      // OWNER identities
      BusinessGroup elm = (BusinessGroup) bgs.get(i);
      retVal.addAll(secManager.getIdentitiesOfSecurityGroup(elm.getOwnerGroup()));
    }
    return retVal;
  }
View Full Code Here

  /**
   * @see org.olat.course.groupsandrights.CourseGroupManager#getParticipantsFromArea(java.lang.String)
   */
  public List getParticipantsFromArea(String areaName) {
    Manager secManager = ManagerFactory.getManager();
    List retVal = new ArrayList();
    List bgs = null;
    if (areaName != null) {
      bgs = getLearningGroupsInAreaFromAllContexts(areaName);
    } else {
      bgs = getAllLearningGroupsFromAllContexts();
    }
    for (int i = 0; i < bgs.size(); i++) {
      // iterates over all business group in the course's area, fetching the
      // PARTIPICIANT identities
      BusinessGroup elm = (BusinessGroup) bgs.get(i);
      retVal.addAll(secManager.getIdentitiesOfSecurityGroup(elm.getPartipiciantGroup()));
    }
    return retVal;
  }
View Full Code Here

    importedRepositoryEntry.setOlatResource(ores);
    RepositoryHandler rh = RepositoryHandlerFactory.getInstance().getRepositoryHandler(importedRepositoryEntry);
    importedRepositoryEntry.setCanLaunch(rh.supportsLaunch());

    // create security group
    Manager securityManager = ManagerFactory.getManager();
    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);
    securityManager.addIdentityToSecurityGroup(owner, newGroup);
    importedRepositoryEntry.setOwnerGroup(newGroup);
    rm.saveRepositoryEntry(importedRepositoryEntry);

    if (!keepSoftkey) {
      // set the new glossary reference
View Full Code Here

      log.audit("+---------------------------------------------------------------+");

      String[] oldGuestUserNames = new String[] { "gast", "guest", "ospite", "invité", "invitado", "episkeptis", "gost", "gosc", "kerencn",
          "kerentw", "gaest", "host", "svecas", "mehman", "convidadopt", "convidadobr", "misafir", "vend&#233;g", "mysafir", "tamu",
          "dhaif", "giast", "gas", "oreah", "khachmoi", "zochin" };
      Manager secMgr = ManagerFactory.getManager();
      for (String guestUserName : oldGuestUserNames) {
        Identity oldGuest = secMgr.findIdentityByName(guestUserName);
        if (oldGuest == null) {
          // skip this one, seems already to be deleted
          continue;
        }
        UserDeletionManager.getInstance().deleteIdentity(oldGuest);
View Full Code Here

  private void createDisclaimerConfirmationForExistingUsers(UpgradeManager upgradeManager) {
    UpgradeHistoryData uhd = upgradeManager.getUpgradesHistory(VERSION);
    if (!uhd.getBooleanDataValue(TASK_CREATE_DISCLAIMER_CONFIRMATION)) {
      // Get all system users
      Manager secMgr = ManagerFactory.getManager();
      RegistrationManager regMgr = RegistrationManager.getInstance();
      DB db = DBFactory.getInstance();
      // Get all users
      List<Identity> identities = secMgr.getVisibleIdentitiesByPowerSearch(null, null, false, null, null, null, null, null);
      // Remove the users that did already confirm the disclaimer
      List<Identity> confirmedIdentities = regMgr.getIdentitiesWithConfirmedDisclaimer();
      PersistenceHelper.removeObjectsFromList(identities, confirmedIdentities);
      // Set the disclaimer property for the remaining users
      for (int i = 0; i < identities.size(); i++) {
View Full Code Here

    // import groups
    cgm.importCourseLearningGroups(courseExportData);
    cgm.importCourseRightGroups(courseExportData);

    // create security group
    Manager securityManager = ManagerFactory.getManager();
    SecurityGroup ownerGroup = securityManager.createAndPersistSecurityGroup();
    // member of this group may modify member's membership
    securityManager.createAndPersistPolicy(ownerGroup, Constants.PERMISSION_ACCESS, ownerGroup);
    // members of this group are always authors also
    securityManager.createAndPersistPolicy(ownerGroup, Constants.PERMISSION_HASROLE, Constants.ORESOURCE_AUTHOR);
    securityManager.addIdentityToSecurityGroup(securityManager.findIdentityByName("administrator"), ownerGroup);
    re.setOwnerGroup(ownerGroup);
    // save the repository entry
    rm.saveRepositoryEntry(re);
    // Create course admin policy for owner group of repository entry
    // -> All owners of repository entries are course admins
    securityManager.createAndPersistPolicy(re.getOwnerGroup(), Constants.PERMISSION_ADMIN, re.getOlatResource());
   
    // deploy any referenced repository entries of the editor structure. This will also
    // include any references in the run structure, since any node in the runstructure is also
    // present in the editor structure.
    deployReferencedRepositoryEntries(courseExportData, course,
View Full Code Here

   * @see org.olat.repository.controllers.IAddController#repositoryEntryCreated(org.olat.repository.RepositoryEntry)
   */
  public void repositoryEntryCreated(RepositoryEntry re) {
    // Create course admin policy for owner group of repository entry
    // -> All owners of repository entries are course admins
    Manager secMgr = ManagerFactory.getManager();
    secMgr.createAndPersistPolicy(re.getOwnerGroup(), Constants.PERMISSION_ADMIN, re.getOlatResource());
    // set root node title
       
    course = CourseFactory.openCourseEditSession(re.getOlatResource().getResourceableId());
    String displayName = re.getDisplayname();
    course.getRunStructure().getRootNode().setShortTitle(Formatter.truncateOnly(displayName, 25)); //do not use truncate!
View Full Code Here

    importedRepositoryEntry.setOlatResource(ores);
    RepositoryHandler rh = RepositoryHandlerFactory.getInstance().getRepositoryHandler(importedRepositoryEntry);
    importedRepositoryEntry.setCanLaunch(rh.supportsLaunch());

    // create security group
    Manager securityManager = ManagerFactory.getManager();
    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);
    securityManager.addIdentityToSecurityGroup(owner, newGroup);
    importedRepositoryEntry.setOwnerGroup(newGroup);
    rm.saveRepositoryEntry(importedRepositoryEntry);

    if (!keepSoftkey) setReference(importedRepositoryEntry, node, importMode);
View Full Code Here

TOP

Related Classes of org.olat.basesecurity.Manager

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.