Commit d8077043 authored by gary's avatar gary

1、角色含超级管理员时,设置用户superAdmin true

parent 4ef494ac
......@@ -296,6 +296,9 @@ public class UserAccountServiceImpl extends AbstractService {
User user = CommonUtils.copyProperties(userAndUserRoleSaveDto, new User());
// 根据cs代码的mapper方法初始化user的isAdmin值
user.setIsAdmin(BooleanUtils.isTrue(userAndUserRoleSaveDto.getIsAdmin()));
if(userAndUserRoleSaveDto.getRoleNames().contains("超级管理员")){
user.setIsSuperAdmin(true);
}
user.setId(CommonUtils.getUUID());
user.setStatus(UserStatus.Active.value());
// loginType:{1:AD认证,2:用户名密码登录验证,3:外部用户登录,使用Email和密码登录,因为目前没有选择登录类型,所以直接设置为3,全部使用密码验证,以后根据需求变更}
......
......@@ -790,6 +790,9 @@ public class UserServiceImpl extends AbstractService {
user.setUserName(userDto.getUserName());
user.setEmail(userDto.getEmail());
user.setIsAdmin(BooleanUtils.isTrue(userDto.getIsAdmin()));
if(userDto.getRoleNames().contains("超级管理员")){
user.setIsSuperAdmin(true);
}
user.setOrganizationId(userDto.getOrganizationId());
user.setUpdateTime(new Date());
List<UserRole> oldUserRoleList = findUserRoleByUserIdWithoutProjectId(user.getId());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment