Package com.google.code.lightssh.project.security.entity

Examples of com.google.code.lightssh.project.security.entity.RoleChange


    if( StringUtils.isEmpty(bizKey) ){
      this.addActionError("业务参数为空!");
      return SUCCESS;
    }
   
    RoleChange rc = roleChangeManager.get(bizKey);
    if( rc == null ){
      this.addActionError("业务数据["+bizKey+"]不存在!");
      return SUCCESS;
    }
   
View Full Code Here


    }else if(AuditStatus.EFFECTIVE.equals(status) ){
      type = EntityChange.Type.UPDATE;
      remark = "角色变更,审核通过后生效!";
    }
   
    RoleChange rc = roleChangeManager.save(user, type, originalRole, newRole,remark);
   
    //启动工作流
    String bizName = "角色变更审核流程_"+db_role.getName()+"_"+user.getLoginName();
    workflowManager.start(WorkflowType.SEC_ROLE.getName(),rc.getId(),bizName,user.getLoginName(),null);
  }
View Full Code Here

      throw new ApplicationException("参数为空!");
   
    if( roleChange == null || StringUtils.isEmpty(roleChange.getId()) )
      throw new ApplicationException("角色变更信息为空!");
   
    RoleChange rc = this.roleChangeManager.get(roleChange);
    if( rc == null )
      throw new ApplicationException("角色变更信息["+roleChange.getId()+"]不存在!");
   
    Role db_role = roleManager.get(roleChange.getRole());
    Role newRole = null;
    byte[] newObject = rc.getNewObject();
    if( newObject != null )
      newRole = (Role)IoSerialUtil.deserialize(newObject);
    if( newObject == null || newRole == null )
      throw new ApplicationException("数据异常,变更角色信息为空!");
   
    boolean passed = AuditResult.LAST_AUDIT_PASSED.equals(ra.getResult());
    if( passed && EntityChange.Type.DELETE.equals(rc.getType()) ){//删除
      db_role.setStatus( AuditStatus.DELETE );
    }else if( passed && AuditStatus.EFFECTIVE.equals(newRole.getStatus())){
      db_role.setName( newRole.getName() );
      db_role.setDescription( newRole.getDescription() );
      db_role.setPermissions( newRole.getPermissions() );
    }else if( passed ){
      db_role.setStatus( AuditStatus.EFFECTIVE );
    }else if( !passed && AuditStatus.NEW.equals( newRole.getStatus() )){
      db_role.setStatus( AuditStatus.AUDIT_REJECT );
    }
   
    roleManager.update(db_role);
    //dao.create(ra); TODO
   
    roleChangeManager.updateStatus(rc.getId()
        ,EntityChange.Status.NEW,EntityChange.Status.FINISHED);
  }
View Full Code Here

 
  public ListPage<RoleAudit> list(ListPage<RoleAudit> page,RoleAudit ra){
    SearchCondition sc = new SearchCondition();
    if( ra != null ){
      if( ra.getRoleChange() != null ){
        RoleChange rc = ra.getRoleChange();
        if( rc.getRole() != null ){
          if( !StringUtils.isEmpty(rc.getRole().getName()) ){
            sc.like("roleChange.role.name", rc.getRole().getName().trim());
          }
        }
      }
    }
   
View Full Code Here

 
  @Override
  public void process(ExecutionType type, String procDefKey,
      String procInstId, String bizKey) {
   
    RoleChange rc = this.roleChangeManager.get(bizKey);
   
    RoleAudit roleAudit = new RoleAudit();
    roleAudit.setRoleChange(rc);//关联角色变更
   
    roleAudit.setUser( null );
View Full Code Here

  public RoleChange save(LoginAccount user,EntityChange.Type type
      ,Role originalRole,Role newRole,String remark){
    if( originalRole == null && newRole == null )
      throw new ApplicationException("原始角色或新角色为空!");
   
    RoleChange rc = new RoleChange();
    rc.setStatus(EntityChange.Status.NEW);
    rc.setOperator(user);
    rc.setType(type);
    rc.setDescription(remark);
   
    if( newRole != null )
      rc.setRole(newRole);
    else
      rc.setRole(originalRole);
   
    if( newRole != null )
      rc.setNewObject( IoSerialUtil.serialize(newRole) );
   
    if( originalRole != null )
      rc.setOriginalObject(IoSerialUtil.serialize(originalRole) );
   
    dao.create(rc);
   
    return rc;
  }
View Full Code Here

TOP

Related Classes of com.google.code.lightssh.project.security.entity.RoleChange

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.