import { AXTranslationService } from '@acorex/core/translation';
import { inject } from '@angular/core';
import { RootConfig } from './acorex-modules-content-management.mjs';

const AXMPermissionsKeys = {
    ContentManagement: {
        Management: 'ContentManagement:Permission:Management',
        Promotion: {
            Management: 'ContentManagement:Permission:Promotion.Management',
            View: 'ContentManagement:Permission:Promotion.View',
            Edit: 'ContentManagement:Permission:Promotion.Edit',
            Delete: 'ContentManagement:Permission:Promotion.Delete',
            Create: 'ContentManagement:Permission:Promotion.Create',
        },
    },
};

class AXMPermissionDefinitionProvider {
    constructor() {
        this.translateService = inject(AXTranslationService);
    }
    async define(context) {
        const trans = async (key) => await this.translateService.translateAsync(`@content-management:permissions.${key}`);
        const keys = AXMPermissionsKeys.ContentManagement;
        context.addGroup(RootConfig.module.name, await trans('manage.title'), await trans('manage.description'))
            //
            .addPermission(keys.Promotion.Management, await trans('promotion.manage.title'), await trans('promotion.manage.description'))
            .addChild(keys.Promotion.View, await trans('promotion.view.title'), await trans('promotion.view.description'))
            .addChild(keys.Promotion.Create, await trans('promotion.create.title'), await trans('promotion.create.description'))
            .addChild(keys.Promotion.Edit, await trans('promotion.edit.title'), await trans('promotion.edit.description'))
            .addChild(keys.Promotion.Delete, await trans('promotion.delete.title'), await trans('promotion.delete.description'))
            .endPermission()
            //
            .endGroup();
    }
}

export { AXMPermissionDefinitionProvider };
//# sourceMappingURL=acorex-modules-content-management-permission-definition.provider-BVc1S-3o.mjs.map
