feat: 优化项目权限与发布鉴权
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { z } from 'zod';
|
||||
|
||||
const permissionLevelSchema = z.enum(['none', 'read', 'build']);
|
||||
const permissionLevelSchema = z.enum(['read', 'build']);
|
||||
|
||||
export const projectPermissionSchema = z.object({
|
||||
projectKey: z.string().trim().min(1).max(80),
|
||||
@@ -21,10 +21,10 @@ export class ProjectPermissionDto {
|
||||
projectKey!: string;
|
||||
|
||||
@ApiProperty({
|
||||
enum: ['none', 'read', 'build'],
|
||||
description: '项目权限:none 无权限,read 只读,build 构建',
|
||||
enum: ['read', 'build'],
|
||||
description: '项目权限:read 只读,build 构建',
|
||||
})
|
||||
level!: 'none' | 'read' | 'build';
|
||||
level!: 'read' | 'build';
|
||||
}
|
||||
|
||||
export class CreateMemberDto {
|
||||
@@ -37,7 +37,7 @@ export class CreateMemberDto {
|
||||
@ApiProperty({
|
||||
type: [ProjectPermissionDto],
|
||||
required: false,
|
||||
description: '成员项目权限,未传项目默认为无权限',
|
||||
description: '成员项目权限,未传或漏传的项目默认为只读权限',
|
||||
})
|
||||
permissions?: ProjectPermissionDto[];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user