Files
SerpentRace/SerpentRace_Backend/dist/Application/Services/AdminBypassService.d.ts
T

61 lines
2.5 KiB
TypeScript

import { UserState } from '../../Domain/User/UserAggregate';
import { Request, Response } from 'express';
/**
* Admin Bypass Service - Centralized admin privilege checking and logging
*/
export declare class AdminBypassService {
/**
* Check if user has admin privileges
* @param userState - User's current state
* @returns true if user is admin
*/
static isAdmin(userState: UserState): boolean;
/**
* Check if user should bypass all restrictions
* @param userState - User's current state
* @returns true if restrictions should be bypassed
*/
static shouldBypassRestrictions(userState: UserState): boolean;
/**
* Log admin bypass action for audit trail
* @param action - Description of the action being bypassed
* @param adminUserId - ID of the admin user
* @param targetId - ID of the target resource
* @param details - Additional details about the bypass
* @param req - Optional request object for context
* @param res - Optional response object for context
*/
static logAdminBypass(action: string, adminUserId: string, targetId: string, details?: any, req?: Request, res?: Response): void;
}
/**
* Admin Audit Service - Enhanced logging for all admin actions
*/
export declare class AdminAuditService {
/**
* Log comprehensive admin action for audit trail
* @param action - Action being performed
* @param adminUserId - ID of the admin user
* @param details - Detailed information about the action
* @param req - Request object for context
* @param res - Response object for context
*/
static logAdminAction(action: string, adminUserId: string, details: {
targetType: 'user' | 'organization' | 'deck' | 'contact' | 'chat';
targetId: string;
operation: 'create' | 'read' | 'update' | 'delete' | 'bypass' | 'export' | 'import';
changes?: any;
sensitive?: boolean;
metadata?: any;
}, req?: Request, res?: Response): void;
/**
* Log bulk admin operations
* @param action - Bulk action being performed
* @param adminUserId - ID of the admin user
* @param affectedCount - Number of resources affected
* @param targetType - Type of resources affected
* @param req - Request object for context
* @param res - Response object for context
*/
static logBulkAdminAction(action: string, adminUserId: string, affectedCount: number, targetType: string, req?: Request, res?: Response): void;
}
//# sourceMappingURL=AdminBypassService.d.ts.map