permissions refactoring

This commit is contained in:
2026-04-12 19:21:04 +02:00
parent 51014395a2
commit 9dcdfb981a
64 changed files with 1842 additions and 656 deletions
+7
View File
@@ -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;
};
-1
View File
@@ -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;
};
+7 -2
View File
@@ -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[];
};