'use strict';
import { permissionCheckerFor } from '../../../meta/decorators/permission-checker-for.js';
import { userIds } from '../constants/user-ids.js';
import { crudActions } from '../../../../fd-toolbox/enums/enums.js';
import { createdByDateProps } from '../../../../fd-toolbox/base-resource/props/created-by-date-props.js';
import { resourceMetaId } from '../../../meta/decorators/resource-id.js';
import { resourceIds } from '../../../../fd-toolbox/constants/resource-id-constants.js';
import { resourceNames } from '../../../../fd-toolbox/resources/resource-names.js';

var __defProp=Object['defineProperty'],__getOwnPropDesc=Object['getOwnPropertyDescriptor'],__name=(_0x1fd07c,_0x23495b)=>__defProp(_0x1fd07c,'name',{'value':_0x23495b,'configurable':!![]}),__decorateClass=(_0x26c0c0,_0x47c20c,_0x3ec73f,_0xd4245e)=>{var _0x5b7c07=_0xd4245e>0x1561+0x5b*0x1e+-0x200a?void(0x4*0x654+0x1*0x3e5+-0x1d35*0x1):_0xd4245e?__getOwnPropDesc(_0x47c20c,_0x3ec73f):_0x47c20c;for(var _0x426b75=_0x26c0c0['length']-(0x251*-0xe+-0x1*-0x1219+-0x2*-0x72b),_0x4439be;_0x426b75>=-0x1d00+-0x1f9+-0x1ef9*-0x1;_0x426b75--)if(_0x4439be=_0x26c0c0[_0x426b75])_0x5b7c07=(_0xd4245e?_0x4439be(_0x47c20c,_0x3ec73f,_0x5b7c07):_0x4439be(_0x5b7c07))||_0x5b7c07;if(_0xd4245e&&_0x5b7c07)__defProp(_0x47c20c,_0x3ec73f,_0x5b7c07);return _0x5b7c07;};let CustomPermissionResource=class{['id'];['workspaceId'];};__name(CustomPermissionResource,'CustomPermissionResource'),CustomPermissionResource=__decorateClass([permissionCheckerFor(resourceNames['customPermissionResource'],onlyPrestonACanAccess),resourceMetaId(resourceIds['customPermissionResource'])],CustomPermissionResource);function onlyPrestonACanAccess(_0x1808f6,_0x851b7d,_0x1d571c){let _0xa53de2=![];return (_0x1d571c===crudActions['view']||_0x1d571c===crudActions['create'])&&(_0xa53de2=_0x851b7d===userIds['prestonAId']),(_0x1d571c===crudActions['update']||_0x1d571c===crudActions['delete'])&&(_0xa53de2=_0x1808f6[createdByDateProps['createdByUserId']]===_0x851b7d),_0xa53de2;}__name(onlyPrestonACanAccess,'onlyPrestonACanAccess');

export { CustomPermissionResource };
