Package org.activiti.engine.identity

Examples of org.activiti.engine.identity.Group


    identityService.createMembership("kermit", "admin");

  }
 
  private Group createGroup(String id, String name, String type) {
    Group group = identityService.newGroup(id);
    group.setName(name);
    group.setType(type);
    identityService.saveGroup(group);
    return group;
  }
View Full Code Here


    identityService.deleteUser("johndoe");
  }

  public void testFindGroupsByUserAndType() {
    Group sales = identityService.newGroup("sales");
    sales.setType("hierarchy");
    identityService.saveGroup(sales);

    Group development = identityService.newGroup("development");
    development.setType("hierarchy");
    identityService.saveGroup(development);

    Group admin = identityService.newGroup("admin");
    admin.setType("security-role");
    identityService.saveGroup(admin);

    Group user = identityService.newGroup("user");
    user.setType("security-role");
    identityService.saveGroup(user);

    User johndoe = identityService.newUser("johndoe");
    identityService.saveUser(johndoe);
View Full Code Here

    identityService.deleteUser("johndoe");
  }

  public void testGroup() {
    Group group = identityService.newGroup("sales");
    group.setName("Sales division");
    identityService.saveGroup(group);

    group = identityService.createGroupQuery().groupId("sales").singleResult();
    assertEquals("sales", group.getId());
    assertEquals("Sales division", group.getName());

    identityService.deleteGroup("sales");
  }
View Full Code Here

    identityService.deleteGroup("sales");
  }

  public void testMembership() {
    Group sales = identityService.newGroup("sales");
    identityService.saveGroup(sales);

    Group development = identityService.newGroup("development");
    identityService.saveGroup(development);

    User johndoe = identityService.newUser("johndoe");
    identityService.saveUser(johndoe);
View Full Code Here

           org.activiti.engine.identity.User activitiUesr = identityService.newUser(ObjectUtils.toString(user.getId()));
           identityService.saveUser(activitiUesr);
         }
         for(Menu menu:menuDao.findAllActivitiList()){
           if (StringUtils.isNotEmpty(menu.getActivitiGroupId())){
             Group group = identityService.newGroup(menu.getActivitiGroupId());
             identityService.saveGroup(group);
           }
         }
         //创建关联关系
         for(User user:userList) {
View Full Code Here

    if (!Global.isSynActivitiIndetity()){
      return;
    }
    try{
      if(menu!=null){
        Group group = identityService.createGroupQuery().groupId(menu.getActivitiGroupId()).singleResult();
        if(group!=null) {
          identityService.deleteGroup(group.getId());
        }
        if(Menu.YES.equals(menu.getIsActiviti()) && StringUtils.isNotBlank(menu.getActivitiGroupId())){
          group = identityService.newGroup(menu.getActivitiGroupId());
          group.setName(menu.getActivitiGroupName());
          identityService.saveGroup(group);
          List<Role> roleList = menuDao.get(menu.getId()).getRoleList();
          if(!Collections3.isEmpty(roleList)) {
            for(Role role:roleList) {
              List<User> userList = role.getUserList();
View Full Code Here

    }
    LdapConnection connection = LDAPConnectionUtil.openConnection(connectionParams);
    try {
      Cursor<SearchResponse> cursor = connection.search(GROUP_ENTRY, searchQuery.toString(), SearchScope.ONELEVEL, "*");
      while (cursor.next()) {
        Group group = new GroupEntity();
        SearchResultEntry response = (SearchResultEntry) cursor.get();
        Iterator<EntryAttribute> itEntry = response.getEntry().iterator();
        while(itEntry.hasNext()) {
          EntryAttribute attribute = itEntry.next();
          String key = attribute.getId();
          if("cn".equalsIgnoreCase(key)) {
            group.setId(attribute.getString());
            group.setName(attribute.getString());
          }
        }

        groupList.add(group);
      }
View Full Code Here

    LdapConnection connection = LDAPConnectionUtil.openConnection(connectionParams);
    try {
      Cursor<SearchResponse> cursor = connection.search(GROUP_ENTRY, "(uniqueMember= uid=" + userId
          + "," + USER_ENTRY + ")", SearchScope.ONELEVEL, "*");
      while (cursor.next()) {
        Group group = new GroupEntity();
        SearchResultEntry response = (SearchResultEntry) cursor.get();
        Iterator<EntryAttribute> itEntry = response.getEntry().iterator();
        while(itEntry.hasNext()) {
          EntryAttribute attribute = itEntry.next();
          String key = attribute.getId();
          if("cn".equalsIgnoreCase(key)) {
            group.setId(attribute.getString());
            group.setName(attribute.getString());
          }
        }

        groupList.add(group);
      }
View Full Code Here

    @Override
    protected Object doExecute() throws Exception {
        IdentityService identityService = getProcessEngine().getIdentityService();

        Group group = identityService.newGroup(id);
        group.setName(name);
        group.setType(type);
        identityService.saveGroup(group);

        return null;
    }
View Full Code Here

TOP

Related Classes of org.activiti.engine.identity.Group

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.