2025-10-29 15:09:22: merge [main:2637770d8299ca2f29cca8cba4524bb3865137cd];

This commit is contained in:
txix committed 2025-10-29 15:09:22 +03:00
1 parent 71a841fee0
commit 88e5ffedad
6 files changed
+17 -6

No files matched your search

+7 -2
View File
@@ -105,8 +105,9 @@ func (u User) GetProfileById(ctx context.Context, userId int64) (*domain.AdminUs
roleIds := RolesIds(roles)
var (
roleList []entity.Role
roleName string
roleList []entity.Role
roleName string
roleNames []string
)
if len(roleIds) != 0 {
roleList, err = u.roleRepoUser.GetRoleByIds(ctx, roleIds)
@@ -115,6 +116,9 @@ func (u User) GetProfileById(ctx context.Context, userId int64) (*domain.AdminUs
}
if len(roleList) > 0 {
roleName = roleList[0].Name
for _, r := range roleList {
roleNames = append(roleNames, r.Name)
}
}
}
@@ -124,6 +128,7 @@ func (u User) GetProfileById(ctx context.Context, userId int64) (*domain.AdminUs
Email: user.Email,
Role: roleName,
Roles: roleIds,
RoleNames: roleNames,
IdleTimeoutMs: u.idleTimeoutMs,
Permissions: mergePermissions(roleList),
}, nil