diff --git a/frontend/src/i18n/locales/en-US.ts b/frontend/src/i18n/locales/en-US.ts index 41bdb143..4f26f39d 100755 --- a/frontend/src/i18n/locales/en-US.ts +++ b/frontend/src/i18n/locales/en-US.ts @@ -3285,6 +3285,13 @@ export default { refreshInviteCode: 'Refresh Invite Code', inviteCodeRefreshed: 'Invite code refreshed', inviteCodeRefreshFailed: 'Failed to refresh invite code', + rbac: { + needTenantAdmin: 'Tenant admin role required', + needTenantAdminTip: 'This action requires the admin role (or higher) in the current tenant. Please contact the tenant owner.', + cannotCreate: 'Your tenant role is insufficient to create a shared space', + cannotJoin: 'Your tenant role is insufficient to join or request to join a shared space', + cannotManage: 'Your tenant role is insufficient to manage this shared space', + }, join: { title: 'Join Space', joining: 'Joining space...', diff --git a/frontend/src/i18n/locales/ko-KR.ts b/frontend/src/i18n/locales/ko-KR.ts index dbbe53bd..a19bd8a0 100755 --- a/frontend/src/i18n/locales/ko-KR.ts +++ b/frontend/src/i18n/locales/ko-KR.ts @@ -3329,6 +3329,13 @@ export default { refreshInviteCode: "초대 코드 새로 고침", inviteCodeRefreshed: "초대 코드가 새로 고쳐졌습니다.", inviteCodeRefreshFailed: "초대 코드를 새로 고치지 못했습니다.", + rbac: { + needTenantAdmin: "테넌트 관리자 권한이 필요합니다", + needTenantAdminTip: "이 작업은 현재 테넌트에서 admin 이상 역할이 필요합니다. 테넌트 소유자에게 문의하세요.", + cannotCreate: "현재 테넌트 역할이 부족하여 공유 공간을 만들 수 없습니다", + cannotJoin: "현재 테넌트 역할이 부족하여 공유 공간에 가입하거나 가입을 신청할 수 없습니다", + cannotManage: "현재 테넌트 역할이 부족하여 공유 공간을 관리할 수 없습니다", + }, join: { title: "스페이스에 참여하기", joining: "스페이스에 참여하는 중..", diff --git a/frontend/src/i18n/locales/ru-RU.ts b/frontend/src/i18n/locales/ru-RU.ts index 15963594..27c1de61 100755 --- a/frontend/src/i18n/locales/ru-RU.ts +++ b/frontend/src/i18n/locales/ru-RU.ts @@ -3811,6 +3811,13 @@ export default { refreshInviteCode: 'Refresh Invite Code', inviteCodeRefreshed: 'Invite code refreshed', inviteCodeRefreshFailed: 'Failed to refresh invite code', + rbac: { + needTenantAdmin: 'Требуется роль администратора тенанта', + needTenantAdminTip: 'Для этого действия требуется роль admin или выше в текущем тенанте. Обратитесь к владельцу тенанта.', + cannotCreate: 'Недостаточно прав в текущем тенанте для создания общего пространства', + cannotJoin: 'Недостаточно прав в текущем тенанте для присоединения к общему пространству', + cannotManage: 'Недостаточно прав в текущем тенанте для управления общим пространством', + }, join: { title: 'Join Space', joining: 'Joining space...', diff --git a/frontend/src/i18n/locales/zh-CN.ts b/frontend/src/i18n/locales/zh-CN.ts index e231442d..2c44535b 100755 --- a/frontend/src/i18n/locales/zh-CN.ts +++ b/frontend/src/i18n/locales/zh-CN.ts @@ -3280,6 +3280,13 @@ export default { refreshInviteCode: "刷新邀请码", inviteCodeRefreshed: "邀请码已刷新", inviteCodeRefreshFailed: "刷新邀请码失败", + rbac: { + needTenantAdmin: "需要租户管理员权限", + needTenantAdminTip: "此操作需要当前租户的 admin 或更高角色,请联系租户 Owner 调整权限。", + cannotCreate: "当前租户角色不足,无法创建共享空间", + cannotJoin: "当前租户角色不足,无法加入或申请加入共享空间", + cannotManage: "当前租户角色不足,无法管理共享空间", + }, join: { title: "加入空间", joining: "正在加入空间...", diff --git a/frontend/src/views/organization/JoinOrganization.vue b/frontend/src/views/organization/JoinOrganization.vue index 6e087e5f..a06d1ce0 100644 --- a/frontend/src/views/organization/JoinOrganization.vue +++ b/frontend/src/views/organization/JoinOrganization.vue @@ -26,11 +26,13 @@ import { useRoute, useRouter } from 'vue-router' import { useI18n } from 'vue-i18n' import { MessagePlugin } from 'tdesign-vue-next' import { useOrganizationStore } from '@/stores/organization' +import { useAuthStore } from '@/stores/auth' const route = useRoute() const router = useRouter() const { t } = useI18n() const orgStore = useOrganizationStore() +const authStore = useAuthStore() const loading = ref(true) const error = ref('') @@ -43,7 +45,14 @@ onMounted(async () => { loading.value = false return } - + + // 后端 POST /organizations/join 要求当前租户角色 ≥ admin,先在前端拦截以给出友好提示 + if (!authStore.hasRole('admin') && !authStore.canAccessAllTenants) { + error.value = t('organization.rbac.cannotJoin') + loading.value = false + return + } + try { const result = await orgStore.join(code) if (result) { diff --git a/frontend/src/views/organization/OrganizationList.vue b/frontend/src/views/organization/OrganizationList.vue index d5a8c55a..6bce9cb5 100644 --- a/frontend/src/views/organization/OrganizationList.vue +++ b/frontend/src/views/organization/OrganizationList.vue @@ -13,25 +13,27 @@