"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.authorizationAllPermissions = exports.roleAllAuthorization = exports.processInstanceAllAuthorization = exports.processInstanceCreateAuthorization = exports.componentAccessAuthorization = exports.resourceCreateAuthorization = void 0;
const resourceCreateAuthorization = (ownerId) => ({
    ownerType: 'ROLE',
    ownerId: ownerId,
    resourceType: 'RESOURCE',
    resourceId: '*',
    accessPermissions: ['CREATE'],
});
exports.resourceCreateAuthorization = resourceCreateAuthorization;
const componentAccessAuthorization = (ownerId) => ({
    ownerType: 'ROLE',
    ownerId: ownerId,
    resourceType: 'COMPONENT',
    resourceId: '*',
    accessPermissions: ['ACCESS'],
});
exports.componentAccessAuthorization = componentAccessAuthorization;
const processInstanceCreateAuthorization = (ownerId, processName) => ({
    ownerType: 'ROLE',
    ownerId: ownerId,
    resourceType: 'PROCESS_DEFINITION',
    resourceId: processName,
    accessPermissions: ['CREATE_PROCESS_INSTANCE'],
});
exports.processInstanceCreateAuthorization = processInstanceCreateAuthorization;
const processInstanceAllAuthorization = (ownerId, processName) => ({
    ownerType: 'ROLE',
    ownerId: ownerId,
    resourceType: 'PROCESS_DEFINITION',
    resourceId: processName,
    accessPermissions: [
        'READ_USER_TASK',
        'DELETE_PROCESS_INSTANCE',
        'CREATE_PROCESS_INSTANCE',
        'UPDATE_PROCESS_INSTANCE',
        'READ_PROCESS_INSTANCE',
        'READ_PROCESS_DEFINITION',
        'UPDATE_USER_TASK',
    ],
});
exports.processInstanceAllAuthorization = processInstanceAllAuthorization;
const roleAllAuthorization = (ownerId) => ({
    ownerType: 'ROLE',
    ownerId: ownerId,
    resourceType: 'ROLE',
    resourceId: '*',
    accessPermissions: ['CREATE', 'DELETE', 'UPDATE', 'READ'],
});
exports.roleAllAuthorization = roleAllAuthorization;
const authorizationAllPermissions = (ownerId) => ({
    ownerType: 'ROLE',
    ownerId: ownerId,
    resourceType: 'AUTHORIZATION',
    resourceId: '*',
    accessPermissions: ['CREATE', 'READ', 'UPDATE', 'DELETE'],
});
exports.authorizationAllPermissions = authorizationAllPermissions;
