permissions refactoring
This commit is contained in:
@@ -2,7 +2,14 @@ import type { UserModel } from '@/types/models/user-model';
|
||||
|
||||
export type User = UserModel;
|
||||
|
||||
export type AuthPermissions = {
|
||||
canManageTeams: boolean;
|
||||
globalAdmin: boolean;
|
||||
projectCreate: boolean;
|
||||
};
|
||||
|
||||
export type Auth = {
|
||||
permissions: AuthPermissions;
|
||||
user: User;
|
||||
};
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ export type UserModel = {
|
||||
email: string;
|
||||
avatar?: string;
|
||||
email_verified_at: string | null;
|
||||
is_admin: boolean;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
};
|
||||
|
||||
@@ -17,6 +17,8 @@ import type { UserGitConnectionModel } from '@/types/models/user-git-connection-
|
||||
import type { UserModel } from '@/types/models/user-model';
|
||||
|
||||
export type AdminUsersPageProps = {
|
||||
directPermissions: Record<string, string[]>;
|
||||
permissionOptions: PermissionOption[];
|
||||
users: UserModel[];
|
||||
status?: string | null;
|
||||
};
|
||||
@@ -31,14 +33,14 @@ export type ProjectShowPageProps = {
|
||||
project: ProjectModel;
|
||||
};
|
||||
|
||||
export type ProjectPermissionOption = {
|
||||
export type PermissionOption = {
|
||||
label: string;
|
||||
value: string;
|
||||
};
|
||||
|
||||
export type ProjectAccessPageProps = {
|
||||
directPermissions: Record<string, string[]>;
|
||||
permissionOptions: ProjectPermissionOption[];
|
||||
permissionOptions: PermissionOption[];
|
||||
project: ProjectModel;
|
||||
status?: string | null;
|
||||
teamPermissions: Record<string, string[]>;
|
||||
@@ -47,7 +49,10 @@ export type ProjectAccessPageProps = {
|
||||
};
|
||||
|
||||
export type TeamsIndexPageProps = {
|
||||
canCreateTeams: boolean;
|
||||
permissionOptions: PermissionOption[];
|
||||
status?: string | null;
|
||||
teamPermissions: Record<string, Record<string, string[]>>;
|
||||
teams: TeamModel[];
|
||||
users: UserModel[];
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user