Package org.olat.basesecurity

Examples of org.olat.basesecurity.SecurityGroup


    if (source == mailNotificationCtr && event == Event.DONE_EVENT) {
      if (mailNotificationCtr.getMailTemplate() != null) {
        List<Identity> ownerList = new ArrayList<Identity>();
        // owners
        Manager securityManager = ManagerFactory.getManager();
        SecurityGroup owners = repositoryEntry.getOwnerGroup();
        if (securityManager.isIdentityInSecurityGroup(ureq.getIdentity(), owners)) {
          ownerList = securityManager.getIdentitiesOfSecurityGroup(owners);
        }
        List<Identity> ccIdentities = new ArrayList<Identity>();
        if (mailNotificationCtr.getMailTemplate().getCpfrom()) {
View Full Code Here


   */
  private void doCleanGroups(Identity identity) {
    ICourse course = CourseFactory.loadCourse(repositoryEntry.getOlatResource());
    if(course != null) {
      Manager securityManager = ManagerFactory.getManager();
      SecurityGroup secGroupOwner = null;
      SecurityGroup secGroupPartipiciant = null;
      SecurityGroup secGroupWaiting = null;
      // LearningGroups
      List allGroups = course.getCourseEnvironment().getCourseGroupManager().getAllLearningGroupsFromAllContexts();
      BGConfigFlags flagsLearning = BGConfigFlags.createLearningGroupDefaultFlags();
      for (Object bGroup : allGroups) {
        secGroupOwner = ((BusinessGroup) bGroup).getOwnerGroup();
View Full Code Here

      // check user rights:
      boolean iAmOlatAdmin = ureq.getUserSession().getRoles().isOLATAdmin();
      identity = ureq.getIdentity();
      Manager secMgr = ManagerFactory.getManager();
      // get user system roles groups from security manager
      SecurityGroup adminGroup = secMgr.findSecurityGroupByName(Constants.GROUP_ADMIN);
      boolean isAdmin = secMgr.isIdentityInSecurityGroup(identity, adminGroup);
      SecurityGroup userManagerGroup = secMgr.findSecurityGroupByName(Constants.GROUP_USERMANAGERS);
      boolean isUserManager = secMgr.isIdentityInSecurityGroup(identity, userManagerGroup);
      SecurityGroup authorGroup = secMgr.findSecurityGroupByName(Constants.GROUP_AUTHORS);
      boolean isAuthor = secMgr.isIdentityInSecurityGroup(identity, authorGroup);
      SecurityGroup groupmanagerGroup = secMgr.findSecurityGroupByName(Constants.GROUP_GROUPMANAGERS);
      boolean isGroupManager = secMgr.isIdentityInSecurityGroup(identity, groupmanagerGroup);

      // usermanager:
      if (isAdmin || isUserManager || iAmOlatAdmin) {
        chkUserManager = uifactory.addCheckboxesVertical("Usermanager", "table.role.useradmin", innerFormLayout, new String[] { "Usermanager" }, new String[] { "" }, null, 1);
View Full Code Here

     * @param roleChangeMap
     * @return
     */
    private String getRoleStatusForIdentity(Identity identity, String securityGroup, HashMap<String, String> roleChangeMap) {
      Manager secMgr = ManagerFactory.getManager();
      SecurityGroup secGroup = secMgr.findSecurityGroupByName(securityGroup);
      Boolean isInGroup = secMgr.isIdentityInSecurityGroup(identity, secGroup);

      String thisRoleAction = "";
      if (roleChangeMap.containsKey(securityGroup)) {
        thisRoleAction = roleChangeMap.get(securityGroup);
View Full Code Here

        oks = new ArrayList<Identity>();
        List<String> isanonymous = new ArrayList<String>();
        List<String> notfounds = new ArrayList<String>();
        List<String> alreadyin = new ArrayList<String>();

        SecurityGroup anonymousSecGroup = securityManager.findSecurityGroupByName(Constants.GROUP_ANONYMOUS);

        // get the logins
        String inp = usersForm.getLoginsString();
        String[] lines = inp.split("\r?\n");
        for (int i = 0; i < lines.length; i++) {
View Full Code Here

      } // for (propertyHandlers)

      // set roles for identity
      // loop over securityGroups defined above
      for (String securityGroup : securityGroups) {
        SecurityGroup secGroup = secMgr.findSecurityGroupByName(securityGroup);
        Boolean isInGroup = secMgr.isIdentityInSecurityGroup(identity, secGroup);
        String thisRoleAction = "";
        if (roleChangeMap.containsKey(securityGroup)) {
          thisRoleAction = roleChangeMap.get(securityGroup);
          // user not anymore in security group, remove him
View Full Code Here

      }
      // 3) Delete the group object itself on the database
      DBFactory.getInstance().deleteObject(businessGroupTodelete);
      // 4) Delete the associated security groups
      if (BusinessGroup.TYPE_BUDDYGROUP.equals(type) || BusinessGroup.TYPE_LEARNINGROUP.equals(type)) {
        SecurityGroup owners = businessGroupTodelete.getOwnerGroup();
        securityManager.deleteSecurityGroup(owners);
      }
      // in all cases the participant groups
      SecurityGroup partips = businessGroupTodelete.getPartipiciantGroup();
      securityManager.deleteSecurityGroup(partips);
      // Delete waiting-group when one exists
      if (businessGroupTodelete.getWaitingGroup() != null) {
        securityManager.deleteSecurityGroup(businessGroupTodelete.getWaitingGroup());
      }
View Full Code Here

    Codepoint.codepoint(this.getClass(), "deleteBusinessGroupWithMail");
   
    // collect data for mail
    Manager secMgr = ManagerFactory.getManager();
    List users = new ArrayList();
    SecurityGroup ownerGroup = businessGroupTodelete.getOwnerGroup();
    if (ownerGroup != null) {
      List owner = secMgr.getIdentitiesOfSecurityGroup(ownerGroup);
      users.addAll(owner);
    }
    SecurityGroup partGroup = businessGroupTodelete.getPartipiciantGroup();
    if (partGroup != null) {
      List participants = secMgr.getIdentitiesOfSecurityGroup(partGroup);
      users.addAll(participants);
    }
    SecurityGroup watiGroup = businessGroupTodelete.getWaitingGroup();
    if (watiGroup != null) {
      List waiting = secMgr.getIdentitiesOfSecurityGroup(watiGroup);
      users.addAll(waiting);
    }
    // now delete the group first
View Full Code Here

  /**
   * @see org.olat.group.BusinessGroupManager#isIdentityInBusinessGroup(org.olat.core.id.Identity,
   *      org.olat.group.BusinessGroup)
   */
  public boolean isIdentityInBusinessGroup(Identity identity, BusinessGroup businessGroup) {
    SecurityGroup participants = businessGroup.getPartipiciantGroup();
    SecurityGroup owners = businessGroup.getOwnerGroup();
    if (participants != null) {
      if (securityManager.isIdentityInSecurityGroup(identity, participants)) return true;
    }
    if (owners != null) {
      if (securityManager.isIdentityInSecurityGroup(identity, owners)) return true;
View Full Code Here

  public BGContext createAndPersistBGContext(String name, String description, String groupType, Identity owner, boolean defaultContext) {
    if (name == null) throw new AssertException("Business group context name must not be null");
    if (groupType == null) throw new AssertException("Business group groupType name must not be null");
    Manager securityManager = ManagerFactory.getManager();
    // 1) create administrative owner security group, add owner if available
    SecurityGroup ownerGroup = securityManager.createAndPersistSecurityGroup();
    if (owner != null) {
      securityManager.addIdentityToSecurityGroup(owner, ownerGroup);
    }
    // 2) create new group context with this security group and save it
    BGContext bgContext = new BGContextImpl(name, description, ownerGroup, groupType, defaultContext);
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.