fix resource permission schema (#2116)

* fix: resource permission schema

* fix: ResorceType
This commit is contained in:
Finley Ge
2024-07-22 17:27:48 +08:00
committed by GitHub
parent 991398b8d2
commit c6f682310c
2 changed files with 7 additions and 4 deletions

View File

@@ -1,11 +1,13 @@
import { TeamMemberWithUserSchema } from '../user/team/type';
import { AuthUserTypeEnum, PermissionKeyEnum } from './constant';
import { AuthUserTypeEnum, PermissionKeyEnum, PerResourceTypeEnum } from './constant';
// PermissionValueType, the type of permission's value is a number, which is a bit field actually.
// It is spired by the permission system in Linux.
// The lowest 3 bits present the permission of reading, writing and managing.
// The higher bits are advanced permissions or extended permissions, which could be customized.
export type PermissionValueType = number;
export type ResourceType = `${PerResourceTypeEnum}`;
export type PermissionListType<T = {}> = Record<
T | PermissionKeyEnum,
{