mirror of
https://github.com/CaramelFur/Picsur.git
synced 2026-06-21 14:30:56 +02:00
rename permissions and add admin image list
This commit is contained in:
@@ -1,9 +0,0 @@
|
||||
import { z } from 'zod';
|
||||
import { createZodDto } from '../../util/create-zod-dto';
|
||||
import { IsPosInt } from '../../validators/positive-int.validator';
|
||||
|
||||
export const PagedRequestSchema = z.object({
|
||||
count: IsPosInt(),
|
||||
page: IsPosInt(),
|
||||
});
|
||||
export class PagedRequest extends createZodDto(PagedRequestSchema) {}
|
||||
@@ -3,11 +3,23 @@ import { EImageSchema } from '../../entities/image.entity';
|
||||
import { createZodDto } from '../../util/create-zod-dto';
|
||||
import { IsPosInt } from '../../validators/positive-int.validator';
|
||||
|
||||
// Image upload
|
||||
export const ImageUploadResponseSchema = EImageSchema;
|
||||
export class ImageUploadResponse extends createZodDto(
|
||||
ImageUploadResponseSchema,
|
||||
) {}
|
||||
|
||||
// Image list
|
||||
|
||||
export const ImageListRequestSchema = z.object({
|
||||
count: IsPosInt(),
|
||||
page: IsPosInt(),
|
||||
user_id: z.string().uuid().optional(),
|
||||
});
|
||||
export class ImageListRequest extends createZodDto(
|
||||
ImageListRequestSchema,
|
||||
) {}
|
||||
|
||||
export const ImageListResponseSchema = z.object({
|
||||
images: z.array(EImageSchema),
|
||||
count: IsPosInt(),
|
||||
|
||||
@@ -8,6 +8,12 @@ import { IsStringList } from '../../validators/string-list.validator';
|
||||
import { EntityIDObjectSchema } from '../id-object.dto';
|
||||
|
||||
// UserList
|
||||
export const UserListRequestSchema = z.object({
|
||||
count: IsPosInt(),
|
||||
page: IsPosInt(),
|
||||
});
|
||||
export class UserListRequest extends createZodDto(UserListRequestSchema) {}
|
||||
|
||||
export const UserListResponseSchema = z.object({
|
||||
users: z.array(EUserSchema),
|
||||
count: IsPosInt(),
|
||||
|
||||
@@ -12,8 +12,8 @@ export enum Permission {
|
||||
|
||||
Settings = 'settings', // Ability to view (personal) settings
|
||||
|
||||
ImageManage = 'image-manage', // Ability to manage everyones manage images
|
||||
UserManage = 'user-manage', // Allow modification of users
|
||||
RoleManage = 'role-manage', // Allow modification of roles
|
||||
SysPrefManage = 'syspref-manage',
|
||||
ImageAdmin = 'image-admin', // Ability to manage everyones manage images
|
||||
UserAdmin = 'user-admin', // Allow modification of users
|
||||
RoleAdmin = 'role-admin', // Allow modification of roles
|
||||
SysPrefAdmin = 'syspref-admin',
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user