Skip to content

fix: user role #3278

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion apps/common/auth/handle/impl/user_token.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,9 @@ def get_role_list(user,
workspace_user_role_mapping in
workspace_user_role_mapping_list] + [user.role], version=version)
else:
role_list = [user.role, get_role_permission(RoleConstants.WORKSPACE_MANAGE, 'default')]
role_list = [user.role]
if user.role == RoleConstants.ADMIN.value.__str__():
role_list = [user.role, get_role_permission(RoleConstants.WORKSPACE_MANAGE, 'default')]
cache.set(key, role_list, version=version)
return role_list
return workspace_list
Expand Down
4 changes: 2 additions & 2 deletions ui/src/router/chat/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ router.beforeEach(
return
}
const { chatUser } = useStore()
const notAuthRouteNameList = ['user_login']
const notAuthRouteNameList = ['login']
if (!notAuthRouteNameList.includes(to.name ? to.name.toString() : '')) {
if (to.params && to.params.accessToken) {
chatUser.setAccessToken(to.params.accessToken.toString())
Expand All @@ -40,7 +40,7 @@ router.beforeEach(
if (authentication) {
if (!token) {
next({
name: 'user_login',
name: 'login',
params: {
accessToken: to.params.accessToken,
},
Expand Down
4 changes: 2 additions & 2 deletions ui/src/router/chat/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ export const routes: Array<RouteRecordRaw> = [
},
// 对话用户登录
{
path: '/user-login/:accessToken',
name: 'user_login',
path: '/login/:accessToken',
name: 'login',
component: () => import('@/views/chat/user-login/index.vue'),
},
// 对话用户登录
Expand Down
Loading