feat(rbac): implement full admin management, dynamic roles, permissions matrix, and workspace access control
- Add Workspace, Role, Permission, RolePermission, AdminRoleAssignment, and AdminWorkspaceAssignment models to Prisma schema\n- Create database migration and RBAC seed script\n- Implement PermissionsGuard, @RequirePermission decorator, and real-time permission resolution in JwtAdminStrategy\n- Implement AdminManagementModule with endpoints for managers CRUD, roles matrix, permissions catalog, and workspaces\n- Secure all sensitive admin controllers with granular permission requirements\n- Add useAuthStore helpers (can, canAny, fetchMe) and v-permission directive\n- Implement Desktop views: AdminListView, AdminFormDrawer (RTL right-side), RoleMatrixView, WorkspaceListView, and ForbiddenView\n- Implement Mobile views: MAdminListView, MAdminFormView (stepped mobile form), MRoleMatrixView, MWorkspaceListView, and MForbiddenView\n- Fix sticky header behavior across desktop and mobile shells\n- Update route guards and device detection logic for mobile prefixing
This commit is contained in:
@@ -13,6 +13,11 @@ export enum AdminRole {
|
||||
SUPPORT = 'SUPPORT',
|
||||
}
|
||||
|
||||
export enum AccessScopeType {
|
||||
ALL = 'ALL',
|
||||
CUSTOM_CAMPAIGNS = 'CUSTOM_CAMPAIGNS',
|
||||
}
|
||||
|
||||
export enum UserStatus {
|
||||
ACTIVE = 'ACTIVE',
|
||||
BLOCKED = 'BLOCKED',
|
||||
@@ -206,4 +211,56 @@ export interface PrizeDistributionDataPoint {
|
||||
percentage: number;
|
||||
}
|
||||
|
||||
export interface PermissionDto {
|
||||
id: string;
|
||||
code: string;
|
||||
module: string;
|
||||
name: string;
|
||||
description?: string | null;
|
||||
}
|
||||
|
||||
export interface RoleDto {
|
||||
id: string;
|
||||
code: string;
|
||||
name: string;
|
||||
description?: string | null;
|
||||
isSystem: boolean;
|
||||
permissions?: PermissionDto[];
|
||||
_count?: {
|
||||
admins?: number;
|
||||
};
|
||||
}
|
||||
|
||||
export interface WorkspaceDto {
|
||||
id: string;
|
||||
name: string;
|
||||
slug: string;
|
||||
description?: string | null;
|
||||
status: string;
|
||||
createdAt: string;
|
||||
_count?: {
|
||||
campaigns?: number;
|
||||
};
|
||||
}
|
||||
|
||||
export interface AdminManagerDto {
|
||||
id: string;
|
||||
name: string;
|
||||
mobile: string;
|
||||
email: string;
|
||||
status: AdminStatus;
|
||||
isSuperAdmin: boolean;
|
||||
lastLoginAt?: string | null;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
roles: Array<{
|
||||
role: RoleDto;
|
||||
}>;
|
||||
workspaceAssignments: Array<{
|
||||
workspace: WorkspaceDto;
|
||||
scopeType: AccessScopeType;
|
||||
specificCampaignIds?: string[] | null;
|
||||
}>;
|
||||
}
|
||||
|
||||
export * from './farsi-number';
|
||||
|
||||
Reference in New Issue
Block a user