import * as i0 from '@angular/core';
import { inject, Injectable } from '@angular/core';
import { AXPSessionService } from '@acorex/platform/auth';

//#endregion
/**
 * CheckPermission Activity (Backend - Mock)
 *
 * Checks if a user has specific permission.
 * Mock implementation for backend/demo; in production would check against real permission system.
 *
 * Execution Mode: backend
 * Activity Type: workflow-activity:check-permission
 *
 * Outcomes:
 * - HasPermission: User has the permission
 * - NoPermission: User does not have the permission
 */
class CheckPermissionActivity {
    constructor() {
        //#region ----   AXPCommand Implementation   ----
        this.sessionService = inject(AXPSessionService);
    }
    async execute(input) {
        const hasPermission = this.sessionService.authorize(input.permission);
        const output = {
            hasPermission,
            userId: input.userId || 'current-user',
            permission: input.permission,
        };
        const outcomes = hasPermission
            ? { HasPermission: true }
            : { NoPermission: true };
        return {
            success: true,
            data: {
                output,
                outcomes,
            },
        };
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: CheckPermissionActivity, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
    static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: CheckPermissionActivity, providedIn: 'root' }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: CheckPermissionActivity, decorators: [{
            type: Injectable,
            args: [{
                    providedIn: 'root',
                }]
        }] });

export { CheckPermissionActivity };
//# sourceMappingURL=acorex-connectivity-mock-check-permission.command-DFcxfjxp.mjs.map
