diff --git a/modules/core/src/main/java/com/bytedesk/core/rbac/user/UserDetailsImpl.java b/modules/core/src/main/java/com/bytedesk/core/rbac/user/UserDetailsImpl.java index b550fd4dcb..14fa5b3c64 100644 --- a/modules/core/src/main/java/com/bytedesk/core/rbac/user/UserDetailsImpl.java +++ b/modules/core/src/main/java/com/bytedesk/core/rbac/user/UserDetailsImpl.java @@ -2,7 +2,7 @@ * @Author: jackning 270580156@qq.com * @Date: 2024-01-23 07:53:01 * @LastEditors: jackning 270580156@qq.com - * @LastEditTime: 2025-03-10 12:00:09 + * @LastEditTime: 2025-04-01 09:57:06 * @Description: bytedesk.com https://github.com/Bytedesk/bytedesk * Please be aware of the BSL license restrictions before installing Bytedesk IM – * selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license. @@ -18,10 +18,12 @@ import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.userdetails.UserDetails; import com.bytedesk.core.rbac.organization.OrganizationEntity; +import com.bytedesk.core.rbac.role.RoleEntity; import lombok.Data; import lombok.extern.slf4j.Slf4j; +import java.time.LocalDateTime; import java.util.Collection; import java.util.Set; @@ -47,10 +49,13 @@ public class UserDetailsImpl implements UserDetails { private boolean mobileVerified; private String platform; // + private String orgUid; + private LocalDateTime createdAt; + private LocalDateTime updatedAt; + // private OrganizationEntity currentOrganization; private Set userOrganizationRoles; - // private Set roles; - // private Set organizations; + private Set currentRoles; Collection authorities; private UserDetailsImpl( @@ -62,15 +67,22 @@ public class UserDetailsImpl implements UserDetails { String mobile, String email, String password, - Collection authorities, - OrganizationEntity currentOrganization, - Set userOrganizationRoles, String description, + // + boolean enabled, boolean superUser, boolean emailVerified, boolean mobileVerified, String platform, - boolean enabled) { + String orgUid, + LocalDateTime createdAt, + LocalDateTime updatedAt, + // + Collection authorities, + OrganizationEntity currentOrganization, + Set currentRoles, + Set userOrganizationRoles + ) { this.id = id; this.uid = uid; this.username = username; @@ -86,9 +98,11 @@ public class UserDetailsImpl implements UserDetails { this.emailVerified = emailVerified; this.mobileVerified = mobileVerified; this.platform = platform; + this.orgUid = orgUid; // this.authorities = authorities; this.currentOrganization = currentOrganization; + this.currentRoles = currentRoles; this.userOrganizationRoles = userOrganizationRoles; } @@ -108,15 +122,19 @@ public class UserDetailsImpl implements UserDetails { user.getMobile(), user.getEmail(), user.getPassword(), - authorities, - user.getCurrentOrganization(), - user.getUserOrganizationRoles(), user.getDescription(), + // + user.isEnabled(), user.isSuperUser(), user.isEmailVerified(), user.isMobileVerified(), user.getPlatform(), - user.isEnabled()); + user.getOrgUid(), + // + authorities, + user.getCurrentOrganization(), + user.getCurrentRoles(), + user.getUserOrganizationRoles()); } @Override diff --git a/modules/core/src/main/java/com/bytedesk/core/rbac/user/UserResponse.java b/modules/core/src/main/java/com/bytedesk/core/rbac/user/UserResponse.java index 1b7fdcd077..1b45d5863a 100644 --- a/modules/core/src/main/java/com/bytedesk/core/rbac/user/UserResponse.java +++ b/modules/core/src/main/java/com/bytedesk/core/rbac/user/UserResponse.java @@ -2,7 +2,7 @@ * @Author: jackning 270580156@qq.com * @Date: 2024-01-29 16:21:24 * @LastEditors: jackning 270580156@qq.com - * @LastEditTime: 2025-03-22 19:24:34 + * @LastEditTime: 2025-04-01 09:51:15 * @Description: bytedesk.com https://github.com/Bytedesk/bytedesk * Please be aware of the BSL license restrictions before installing Bytedesk IM – * selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license. @@ -58,6 +58,5 @@ public class UserResponse extends BaseResponse { private OrganizationResponseSimple currentOrganization; private Set currentRoles; private Set userOrganizationRoles; - // private Set authorities; }