mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-04 15:14:10 +00:00
fix(webui): correct settings role check and tighten DTO role types
This commit is contained in:
@@ -46,7 +46,7 @@ export type GetProjectTeamResponse = z.infer<typeof getProjectTeamResponseSchema
|
|||||||
export const projectUserInfoSchema = z.object({
|
export const projectUserInfoSchema = z.object({
|
||||||
id: z.string(),
|
id: z.string(),
|
||||||
name: z.string(),
|
name: z.string(),
|
||||||
role: z.string(),
|
role: z.enum(['owner', 'editor', 'reviewer', 'bot', 'unknown']),
|
||||||
image: z.string().optional(),
|
image: z.string().optional(),
|
||||||
})
|
})
|
||||||
export type ProjectUserInfo = z.infer<typeof projectUserInfoSchema>
|
export type ProjectUserInfo = z.infer<typeof projectUserInfoSchema>
|
||||||
@@ -96,7 +96,7 @@ export interface ServiceListProjectsRequest {
|
|||||||
export interface ServiceAddProjectMemberRequest {
|
export interface ServiceAddProjectMemberRequest {
|
||||||
projectId: string
|
projectId: string
|
||||||
userId: string
|
userId: string
|
||||||
role: string
|
role: 'owner' | 'editor' | 'reviewer' | 'bot' | 'unknown'
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ServiceListProjectMembersRequest {
|
export interface ServiceListProjectMembersRequest {
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ export const getMeResponseSchema = z.object({
|
|||||||
id: z.string(),
|
id: z.string(),
|
||||||
name: z.string(),
|
name: z.string(),
|
||||||
email: z.string().optional(),
|
email: z.string().optional(),
|
||||||
role: z.string(),
|
role: z.enum(['owner', 'editor', 'reviewer', 'bot', 'unknown']),
|
||||||
image: z.string().optional(),
|
image: z.string().optional(),
|
||||||
unreadNotificationCount: z.number().optional(),
|
unreadNotificationCount: z.number().optional(),
|
||||||
})
|
})
|
||||||
@@ -48,7 +48,7 @@ export type UpdateMeRequest = z.infer<typeof updateMeRequestSchema>
|
|||||||
export const userInfoSchema = z.object({
|
export const userInfoSchema = z.object({
|
||||||
id: z.string(),
|
id: z.string(),
|
||||||
name: z.string(),
|
name: z.string(),
|
||||||
role: z.string(),
|
role: z.enum(['owner', 'editor', 'reviewer', 'bot', 'unknown']),
|
||||||
email: z.string().optional(),
|
email: z.string().optional(),
|
||||||
type: z.enum(['human', 'agent']).optional(),
|
type: z.enum(['human', 'agent']).optional(),
|
||||||
image: z.string().optional(),
|
image: z.string().optional(),
|
||||||
|
|||||||
@@ -233,7 +233,7 @@ function TeamSettingsPage() {
|
|||||||
)}
|
)}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
{me?.role === 'admin' && (
|
{me?.role === 'owner' && (
|
||||||
<button
|
<button
|
||||||
onClick={() => setActiveTab('transcode')}
|
onClick={() => setActiveTab('transcode')}
|
||||||
className={cn(
|
className={cn(
|
||||||
@@ -267,7 +267,7 @@ function TeamSettingsPage() {
|
|||||||
)}
|
)}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
{me?.role === 'admin' && (
|
{me?.role === 'owner' && (
|
||||||
<>
|
<>
|
||||||
<div className="mt-6 mb-2 px-4 text-xs font-semibold text-sidebar-foreground/60 uppercase tracking-wider pt-4 border-t border-sidebar-border">
|
<div className="mt-6 mb-2 px-4 text-xs font-semibold text-sidebar-foreground/60 uppercase tracking-wider pt-4 border-t border-sidebar-border">
|
||||||
AI
|
AI
|
||||||
|
|||||||
Reference in New Issue
Block a user