@webiny/app-admin 6.0.0-rc.1 → 6.0.0-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/DeveloperMode/DeveloperMode.d.ts +11 -0
- package/components/DeveloperMode/DeveloperMode.js +17 -0
- package/components/DeveloperMode/DeveloperMode.js.map +1 -0
- package/components/DeveloperMode/index.d.ts +2 -0
- package/components/DeveloperMode/index.js +3 -0
- package/components/DeveloperMode/index.js.map +1 -0
- package/components/LexicalEditor/LexicalLinkForm.js +10 -1
- package/components/LexicalEditor/LexicalLinkForm.js.map +1 -1
- package/components/Wcp.d.ts +2 -0
- package/components/Wcp.js +8 -1
- package/components/Wcp.js.map +1 -1
- package/components/index.d.ts +1 -0
- package/components/index.js +1 -0
- package/components/index.js.map +1 -1
- package/exports/admin/ui.d.ts +1 -0
- package/exports/admin/ui.js +1 -0
- package/exports/admin/ui.js.map +1 -1
- package/features/wcp/ReactLicense.d.ts +1 -0
- package/features/wcp/ReactLicense.js +3 -0
- package/features/wcp/ReactLicense.js.map +1 -1
- package/package.json +25 -28
- package/permissions/PermissionRenderer.js +25 -17
- package/permissions/PermissionRenderer.js.map +1 -1
- package/permissions/types.d.ts +24 -6
- package/permissions/types.js.map +1 -1
- package/permissions/usePermissionForm.js +45 -5
- package/permissions/usePermissionForm.js.map +1 -1
- package/permissions/usePermissions.js +2 -1
- package/permissions/usePermissions.js.map +1 -1
- package/extensions/AdminBuildParam.d.ts +0 -11
- package/extensions/AdminBuildParam.js +0 -184
- package/extensions/AdminBuildParam.js.map +0 -1
- package/extensions/AdminExtension.d.ts +0 -11
- package/extensions/AdminExtension.js +0 -99
- package/extensions/AdminExtension.js.map +0 -1
- package/extensions/index.d.ts +0 -23
- package/extensions/index.js +0 -7
- package/extensions/index.js.map +0 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Component is used to display something that you want to be hidden to everyone except Webiny team.
|
|
3
|
+
* Example usage is in Workflow State Bar, where we need some button to be present only while developing the feature - and debugging.
|
|
4
|
+
* @see packages/app-workflows/src/Components/WorkflowState/Bar/Bars/WorkflowStateBarApproved.tsx
|
|
5
|
+
* @see packages/app-workflows/src/Components/WorkflowState/Bar/Bars/WorkflowStateBarRejected.tsx
|
|
6
|
+
*/
|
|
7
|
+
import React from "react";
|
|
8
|
+
export interface IDeveloperModeProps {
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
export declare const DeveloperMode: ({ children }: IDeveloperModeProps) => React.JSX.Element | null;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Component is used to display something that you want to be hidden to everyone except Webiny team.
|
|
3
|
+
* Example usage is in Workflow State Bar, where we need some button to be present only while developing the feature - and debugging.
|
|
4
|
+
* @see packages/app-workflows/src/Components/WorkflowState/Bar/Bars/WorkflowStateBarApproved.tsx
|
|
5
|
+
* @see packages/app-workflows/src/Components/WorkflowState/Bar/Bars/WorkflowStateBarRejected.tsx
|
|
6
|
+
*/
|
|
7
|
+
import React from "react";
|
|
8
|
+
export const DeveloperMode = ({
|
|
9
|
+
children
|
|
10
|
+
}) => {
|
|
11
|
+
if (process.env.WEBINY_ADMIN_DEV_MODE !== "true") {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, children);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=DeveloperMode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","DeveloperMode","children","process","env","WEBINY_ADMIN_DEV_MODE","createElement","Fragment"],"sources":["DeveloperMode.tsx"],"sourcesContent":["/**\n * Component is used to display something that you want to be hidden to everyone except Webiny team.\n * Example usage is in Workflow State Bar, where we need some button to be present only while developing the feature - and debugging.\n * @see packages/app-workflows/src/Components/WorkflowState/Bar/Bars/WorkflowStateBarApproved.tsx\n * @see packages/app-workflows/src/Components/WorkflowState/Bar/Bars/WorkflowStateBarRejected.tsx\n */\nimport React from \"react\";\n\nexport interface IDeveloperModeProps {\n children: React.ReactNode;\n}\n\nexport const DeveloperMode = ({ children }: IDeveloperModeProps) => {\n if (process.env.WEBINY_ADMIN_DEV_MODE !== \"true\") {\n return null;\n }\n return <>{children}</>;\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,OAAOA,KAAK,MAAM,OAAO;AAMzB,OAAO,MAAMC,aAAa,GAAGA,CAAC;EAAEC;AAA8B,CAAC,KAAK;EAChE,IAAIC,OAAO,CAACC,GAAG,CAACC,qBAAqB,KAAK,MAAM,EAAE;IAC9C,OAAO,IAAI;EACf;EACA,oBAAOL,KAAA,CAAAM,aAAA,CAAAN,KAAA,CAAAO,QAAA,QAAGL,QAAW,CAAC;AAC1B,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["DeveloperMode"],"sources":["index.ts"],"sourcesContent":["export { DeveloperMode } from \"./DeveloperMode.js\";\nexport type { IDeveloperModeProps } from \"./DeveloperMode.js\";\n"],"mappings":"AAAA,SAASA,aAAa","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import React, { useEffect, useRef } from "react";
|
|
2
2
|
import { Button, Grid, Icon, IconButton, Input, Switch } from "@webiny/admin-ui";
|
|
3
3
|
import { Form, useBind } from "@webiny/form";
|
|
4
4
|
import { validation } from "@webiny/validation";
|
|
@@ -42,16 +42,25 @@ export const LexicalLinkForm = ({
|
|
|
42
42
|
}))));
|
|
43
43
|
};
|
|
44
44
|
const UrlInput = () => {
|
|
45
|
+
const inputRef = useRef(null);
|
|
45
46
|
const urlBind = useBind({
|
|
46
47
|
name: "url",
|
|
47
48
|
validators: validation.create("required,url")
|
|
48
49
|
});
|
|
50
|
+
useEffect(() => {
|
|
51
|
+
if (inputRef.current) {
|
|
52
|
+
setTimeout(() => {
|
|
53
|
+
inputRef.current?.focus();
|
|
54
|
+
}, 10);
|
|
55
|
+
}
|
|
56
|
+
}, []);
|
|
49
57
|
const openInNewTab = () => {
|
|
50
58
|
if (urlBind.validation.isValid !== false && urlBind.value) {
|
|
51
59
|
window.open(urlBind.value, "_blank");
|
|
52
60
|
}
|
|
53
61
|
};
|
|
54
62
|
return /*#__PURE__*/React.createElement(Input, Object.assign({}, urlBind, {
|
|
63
|
+
inputRef: ref => inputRef.current = ref,
|
|
55
64
|
variant: "secondary",
|
|
56
65
|
placeholder: "Enter link",
|
|
57
66
|
autoFocus: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Button","Grid","Icon","IconButton","Input","Switch","Form","useBind","validation","ReactComponent","GlobeIcon","OpenInNew","RemoveLink","LexicalLinkForm","linkData","onSave","removeLink","onSubmit","data","createElement","validateOnFirstSubmit","submitOnEnter","form","className","gap","Column","span","UrlInput","TargetSwitch","variant","text","onClick","icon","label","submit","urlBind","name","validators","create","openInNewTab","isValid","value","window","open","Object","assign","placeholder","autoFocus","startIcon","endIcon","targetBind","defaultValue","checked","onChange"],"sources":["LexicalLinkForm.tsx"],"sourcesContent":["import React from \"react\";\nimport type { FloatingLinkEditorPlugin } from \"@webiny/lexical-editor\";\nimport { Button, Grid, Icon, IconButton, Input, Switch } from \"@webiny/admin-ui\";\nimport { Form, useBind } from \"@webiny/form\";\nimport { validation } from \"@webiny/validation\";\nimport { ReactComponent as GlobeIcon } from \"@webiny/icons/language.svg\";\nimport { ReactComponent as OpenInNew } from \"@webiny/icons/open_in_new.svg\";\nimport { ReactComponent as RemoveLink } from \"@webiny/icons/link_off.svg\";\n\ntype LexicalLinkForm = NonNullable<\n React.ComponentProps<typeof FloatingLinkEditorPlugin>[\"LinkForm\"]\n>;\ntype LinkFormProps = React.ComponentProps<LexicalLinkForm>;\n\nexport const LexicalLinkForm = ({ linkData, onSave, removeLink }: LinkFormProps) => {\n const onSubmit = (data: LinkFormProps[\"linkData\"]) => {\n onSave(data);\n };\n\n return (\n <Form data={linkData} onSubmit={onSubmit} validateOnFirstSubmit submitOnEnter>\n {form => (\n <div className={\"p-md\"}>\n <Grid gap={\"small\"}>\n <Grid.Column span={12}>\n <UrlInput />\n </Grid.Column>\n </Grid>\n <div className={\"flex w-full items-center justify-between mt-sm gap-sm\"}>\n <TargetSwitch />\n <Button\n variant={\"ghost\"}\n text={`Remove link`}\n className={\"text-destructive-primary! [&_svg]:fill-destructive\"}\n onClick={removeLink}\n icon={<Icon label={\"Remove link\"} icon={<RemoveLink />} />}\n />\n <Button variant={\"primary\"} text={`Save`} onClick={form.submit} />\n </div>\n </div>\n )}\n </Form>\n );\n};\n\nconst UrlInput = () => {\n const urlBind = useBind({\n name: \"url\",\n validators: validation.create(\"required,url\")\n });\n\n const openInNewTab = () => {\n if (urlBind.validation.isValid !== false && urlBind.value) {\n window.open(urlBind.value, \"_blank\");\n }\n };\n\n return (\n <Input\n {...urlBind}\n variant={\"secondary\"}\n placeholder={\"Enter link\"}\n autoFocus={true}\n startIcon={<Icon label=\"globe\" icon={<GlobeIcon />} />}\n endIcon={<IconButton variant=\"ghost\" icon={<OpenInNew />} onClick={openInNewTab} />}\n />\n );\n};\n\nconst TargetSwitch = () => {\n const targetBind = useBind({\n name: \"target\",\n defaultValue: \"_self\"\n });\n\n return (\n <Switch\n checked={targetBind.value === \"_blank\"}\n label={\"Open in new tab\"}\n onChange={value => {\n targetBind.onChange(value === true ? \"_blank\" : \"_self\");\n }}\n />\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;
|
|
1
|
+
{"version":3,"names":["React","useEffect","useRef","Button","Grid","Icon","IconButton","Input","Switch","Form","useBind","validation","ReactComponent","GlobeIcon","OpenInNew","RemoveLink","LexicalLinkForm","linkData","onSave","removeLink","onSubmit","data","createElement","validateOnFirstSubmit","submitOnEnter","form","className","gap","Column","span","UrlInput","TargetSwitch","variant","text","onClick","icon","label","submit","inputRef","urlBind","name","validators","create","current","setTimeout","focus","openInNewTab","isValid","value","window","open","Object","assign","ref","placeholder","autoFocus","startIcon","endIcon","targetBind","defaultValue","checked","onChange"],"sources":["LexicalLinkForm.tsx"],"sourcesContent":["import React, { useEffect, useRef } from \"react\";\nimport type { FloatingLinkEditorPlugin } from \"@webiny/lexical-editor\";\nimport { Button, Grid, Icon, IconButton, Input, Switch } from \"@webiny/admin-ui\";\nimport { Form, useBind } from \"@webiny/form\";\nimport { validation } from \"@webiny/validation\";\nimport { ReactComponent as GlobeIcon } from \"@webiny/icons/language.svg\";\nimport { ReactComponent as OpenInNew } from \"@webiny/icons/open_in_new.svg\";\nimport { ReactComponent as RemoveLink } from \"@webiny/icons/link_off.svg\";\n\ntype LexicalLinkForm = NonNullable<\n React.ComponentProps<typeof FloatingLinkEditorPlugin>[\"LinkForm\"]\n>;\ntype LinkFormProps = React.ComponentProps<LexicalLinkForm>;\n\nexport const LexicalLinkForm = ({ linkData, onSave, removeLink }: LinkFormProps) => {\n const onSubmit = (data: LinkFormProps[\"linkData\"]) => {\n onSave(data);\n };\n\n return (\n <Form data={linkData} onSubmit={onSubmit} validateOnFirstSubmit submitOnEnter>\n {form => (\n <div className={\"p-md\"}>\n <Grid gap={\"small\"}>\n <Grid.Column span={12}>\n <UrlInput />\n </Grid.Column>\n </Grid>\n <div className={\"flex w-full items-center justify-between mt-sm gap-sm\"}>\n <TargetSwitch />\n <Button\n variant={\"ghost\"}\n text={`Remove link`}\n className={\"text-destructive-primary! [&_svg]:fill-destructive\"}\n onClick={removeLink}\n icon={<Icon label={\"Remove link\"} icon={<RemoveLink />} />}\n />\n <Button variant={\"primary\"} text={`Save`} onClick={form.submit} />\n </div>\n </div>\n )}\n </Form>\n );\n};\n\nconst UrlInput = () => {\n const inputRef = useRef<HTMLInputElement | null>(null);\n\n const urlBind = useBind({\n name: \"url\",\n validators: validation.create(\"required,url\")\n });\n\n useEffect(() => {\n if (inputRef.current) {\n setTimeout(() => {\n inputRef.current?.focus();\n }, 10);\n }\n }, []);\n\n const openInNewTab = () => {\n if (urlBind.validation.isValid !== false && urlBind.value) {\n window.open(urlBind.value, \"_blank\");\n }\n };\n\n return (\n <Input\n {...urlBind}\n inputRef={ref => (inputRef.current = ref)}\n variant={\"secondary\"}\n placeholder={\"Enter link\"}\n autoFocus={true}\n startIcon={<Icon label=\"globe\" icon={<GlobeIcon />} />}\n endIcon={<IconButton variant=\"ghost\" icon={<OpenInNew />} onClick={openInNewTab} />}\n />\n );\n};\n\nconst TargetSwitch = () => {\n const targetBind = useBind({\n name: \"target\",\n defaultValue: \"_self\"\n });\n\n return (\n <Switch\n checked={targetBind.value === \"_blank\"}\n label={\"Open in new tab\"}\n onChange={value => {\n targetBind.onChange(value === true ? \"_blank\" : \"_self\");\n }}\n />\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,MAAM,QAAQ,OAAO;AAEhD,SAASC,MAAM,EAAEC,IAAI,EAAEC,IAAI,EAAEC,UAAU,EAAEC,KAAK,EAAEC,MAAM,QAAQ,kBAAkB;AAChF,SAASC,IAAI,EAAEC,OAAO,QAAQ,cAAc;AAC5C,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,cAAc,IAAIC,SAAS,QAAQ,4BAA4B;AACxE,SAASD,cAAc,IAAIE,SAAS,QAAQ,+BAA+B;AAC3E,SAASF,cAAc,IAAIG,UAAU,QAAQ,4BAA4B;AAOzE,OAAO,MAAMC,eAAe,GAAGA,CAAC;EAAEC,QAAQ;EAAEC,MAAM;EAAEC;AAA0B,CAAC,KAAK;EAChF,MAAMC,QAAQ,GAAIC,IAA+B,IAAK;IAClDH,MAAM,CAACG,IAAI,CAAC;EAChB,CAAC;EAED,oBACIrB,KAAA,CAAAsB,aAAA,CAACb,IAAI;IAACY,IAAI,EAAEJ,QAAS;IAACG,QAAQ,EAAEA,QAAS;IAACG,qBAAqB;IAACC,aAAa;EAAA,GACxEC,IAAI,iBACDzB,KAAA,CAAAsB,aAAA;IAAKI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AAO,CAAC;IAC5D;EAAE,CACL,CAAC;AAEV,CAAC","ignoreList":[]}
|
package/components/Wcp.d.ts
CHANGED
|
@@ -6,10 +6,12 @@ declare function CanUseTeams({ children }: ChildrenProps): React.JSX.Element | n
|
|
|
6
6
|
declare function CanUsePrivateFiles({ children }: ChildrenProps): React.JSX.Element | null;
|
|
7
7
|
declare function CanUseFileManagerThreatDetection({ children }: ChildrenProps): React.JSX.Element | null;
|
|
8
8
|
declare function CanUseWorkflows({ children }: ChildrenProps): React.JSX.Element | null;
|
|
9
|
+
declare function CanUseHcmsFieldPermissions({ children }: ChildrenProps): React.JSX.Element | null;
|
|
9
10
|
export declare const Wcp: {
|
|
10
11
|
CanUseTeams: typeof CanUseTeams;
|
|
11
12
|
CanUsePrivateFiles: typeof CanUsePrivateFiles;
|
|
12
13
|
CanUseFileManagerThreatDetection: typeof CanUseFileManagerThreatDetection;
|
|
13
14
|
CanUseWorkflows: typeof CanUseWorkflows;
|
|
15
|
+
CanUseHcmsFieldPermissions: typeof CanUseHcmsFieldPermissions;
|
|
14
16
|
};
|
|
15
17
|
export {};
|
package/components/Wcp.js
CHANGED
|
@@ -24,11 +24,18 @@ function CanUseWorkflows({
|
|
|
24
24
|
const wcp = useWcp();
|
|
25
25
|
return wcp.canUseWorkflows() ? /*#__PURE__*/React.createElement(React.Fragment, null, children) : null;
|
|
26
26
|
}
|
|
27
|
+
function CanUseHcmsFieldPermissions({
|
|
28
|
+
children
|
|
29
|
+
}) {
|
|
30
|
+
const wcp = useWcp();
|
|
31
|
+
return wcp.canUseHcmsFieldPermissions() ? /*#__PURE__*/React.createElement(React.Fragment, null, children) : null;
|
|
32
|
+
}
|
|
27
33
|
export const Wcp = {
|
|
28
34
|
CanUseTeams,
|
|
29
35
|
CanUsePrivateFiles,
|
|
30
36
|
CanUseFileManagerThreatDetection,
|
|
31
|
-
CanUseWorkflows
|
|
37
|
+
CanUseWorkflows,
|
|
38
|
+
CanUseHcmsFieldPermissions
|
|
32
39
|
};
|
|
33
40
|
|
|
34
41
|
//# sourceMappingURL=Wcp.js.map
|
package/components/Wcp.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useWcp","CanUseTeams","children","wcp","canUseTeams","createElement","Fragment","CanUsePrivateFiles","canUsePrivateFiles","CanUseFileManagerThreatDetection","canUseFileManagerThreatDetection","CanUseWorkflows","canUseWorkflows","Wcp"],"sources":["Wcp.tsx"],"sourcesContent":["import React from \"react\";\nimport { useWcp } from \"~/presentation/wcp/useWcp.js\";\n\ninterface ChildrenProps {\n children: React.ReactNode;\n}\n\nfunction CanUseTeams({ children }: ChildrenProps) {\n const wcp = useWcp();\n
|
|
1
|
+
{"version":3,"names":["React","useWcp","CanUseTeams","children","wcp","canUseTeams","createElement","Fragment","CanUsePrivateFiles","canUsePrivateFiles","CanUseFileManagerThreatDetection","canUseFileManagerThreatDetection","CanUseWorkflows","canUseWorkflows","CanUseHcmsFieldPermissions","canUseHcmsFieldPermissions","Wcp"],"sources":["Wcp.tsx"],"sourcesContent":["import React from \"react\";\nimport { useWcp } from \"~/presentation/wcp/useWcp.js\";\n\ninterface ChildrenProps {\n children: React.ReactNode;\n}\n\nfunction CanUseTeams({ children }: ChildrenProps) {\n const wcp = useWcp();\n return wcp.canUseTeams() ? <>{children}</> : null;\n}\n\nfunction CanUsePrivateFiles({ children }: ChildrenProps) {\n const wcp = useWcp();\n return wcp.canUsePrivateFiles() ? <>{children}</> : null;\n}\n\nfunction CanUseFileManagerThreatDetection({ children }: ChildrenProps) {\n const wcp = useWcp();\n return wcp.canUseFileManagerThreatDetection() ? <>{children}</> : null;\n}\n\nfunction CanUseWorkflows({ children }: ChildrenProps) {\n const wcp = useWcp();\n return wcp.canUseWorkflows() ? <>{children}</> : null;\n}\n\nfunction CanUseHcmsFieldPermissions({ children }: ChildrenProps) {\n const wcp = useWcp();\n return wcp.canUseHcmsFieldPermissions() ? <>{children}</> : null;\n}\n\nexport const Wcp = {\n CanUseTeams,\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KAAA,CAAAM,aAAA,CAAAN,KAAA,CAAAO,QAAA,QAAGJ,QAAW,CAAC,GAAG,IAAI;AACpE;AAEA,OAAO,MAAMa,GAAG,GAAG;EACfd,WAAW;EACXM,kBAAkB;EAClBE,gCAAgC;EAChCE,eAAe;EACfE;AACJ,CAAC","ignoreList":[]}
|
package/components/index.d.ts
CHANGED
|
@@ -27,3 +27,4 @@ export * from "../components/RolesMultiAutocomplete/index.js";
|
|
|
27
27
|
export * from "../components/RoleAutocomplete/index.js";
|
|
28
28
|
export * from "../components/TeamAutocomplete/index.js";
|
|
29
29
|
export * from "../components/TeamsMultiAutocomplete/index.js";
|
|
30
|
+
export * from "./DeveloperMode/index.js";
|
package/components/index.js
CHANGED
|
@@ -26,5 +26,6 @@ export * from "./RolesMultiAutocomplete/index.js";
|
|
|
26
26
|
export * from "./RoleAutocomplete/index.js";
|
|
27
27
|
export * from "./TeamAutocomplete/index.js";
|
|
28
28
|
export * from "./TeamsMultiAutocomplete/index.js";
|
|
29
|
+
export * from "./DeveloperMode/index.js";
|
|
29
30
|
|
|
30
31
|
//# sourceMappingURL=index.js.map
|
package/components/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["FileManager","FloatingPanel","StateInspector","NavigationPrompt","DialogsProvider","OverlayLayout","EmptyView","SimpleFormContent","SimpleForm","SimpleFormFooter","SimpleFormHeader","default","SingleImageUpload","LexicalEditor","LexicalLinkForm","Wcp","RegisterFeature"],"sources":["index.ts"],"sourcesContent":["export { FileManager } from \"~/base/ui/FileManager.js\";\nexport { FloatingPanel } from \"~/components/FloatingPanel.js\";\nexport { StateInspector } from \"~/components/StateInspector.js\";\nexport { NavigationPrompt } from \"~/components/NavigationPrompt.js\";\nexport * from \"~/components/AdminLayout.js\";\nexport * from \"~/components/Buttons/index.js\";\nexport { DialogsProvider } from \"~/components/Dialogs/DialogsContext.js\";\nexport * from \"~/components/OptionsMenu/index.js\";\nexport * from \"~/components/Filters/index.js\";\nexport * from \"~/components/BulkActions/index.js\";\nexport { OverlayLayout, type OverlayLayoutProps } from \"~/components/OverlayLayout/index.js\";\nexport { type EmptyViewProps, EmptyView } from \"~/components/EmptyView.js\";\nexport {\n SimpleFormContent,\n SimpleForm,\n SimpleFormFooter,\n SimpleFormHeader\n} from \"~/components/SimpleForm/index.js\";\nexport {\n default as SingleImageUpload,\n type SingleImageUploadProps\n} from \"~/components/SingleImageUpload.js\";\nexport { LexicalEditor } from \"~/components/LexicalEditor/index.js\";\nexport type { RichTextValueWithHtml } from \"~/components/LexicalEditor/index.js\";\nexport { LexicalLinkForm } from \"~/components/LexicalEditor/index.js\";\nexport { Wcp } from \"~/components/Wcp.js\";\nexport * from \"~/components/IconPicker/index.js\";\nexport * from \"~/components/NavigationPrompt.js\";\nexport * from \"~/components/SplitView/index.js\";\nexport * from \"~/components/Permissions/index.js\";\nexport * from \"~/components/SearchUI.js\";\nexport * from \"~/components/RegisterFeature.js\";\nexport { RegisterFeature } from \"~/components/RegisterFeature.js\";\nexport * from \"~/components/RolesMultiAutocomplete/index.js\";\nexport * from \"~/components/RoleAutocomplete/index.js\";\nexport * from \"~/components/TeamAutocomplete/index.js\";\nexport * from \"~/components/TeamsMultiAutocomplete/index.js\";\n"],"mappings":"AAAA,SAASA,WAAW;AACpB,SAASC,aAAa;AACtB,SAASC,cAAc;AACvB,SAASC,gBAAgB;AACzB;AACA;AACA,SAASC,eAAe;AACxB;AACA;AACA;AACA,SAASC,aAAa;AACtB,SAA8BC,SAAS;AACvC,SACIC,iBAAiB,EACjBC,UAAU,EACVC,gBAAgB,EAChBC,gBAAgB;AAEpB,SACIC,OAAO,IAAIC,iBAAiB;AAGhC,SAASC,aAAa;AAEtB,SAASC,eAAe;AACxB,SAASC,GAAG;AACZ;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,eAAe;AACxB;AACA;AACA;AACA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["FileManager","FloatingPanel","StateInspector","NavigationPrompt","DialogsProvider","OverlayLayout","EmptyView","SimpleFormContent","SimpleForm","SimpleFormFooter","SimpleFormHeader","default","SingleImageUpload","LexicalEditor","LexicalLinkForm","Wcp","RegisterFeature"],"sources":["index.ts"],"sourcesContent":["export { FileManager } from \"~/base/ui/FileManager.js\";\nexport { FloatingPanel } from \"~/components/FloatingPanel.js\";\nexport { StateInspector } from \"~/components/StateInspector.js\";\nexport { NavigationPrompt } from \"~/components/NavigationPrompt.js\";\nexport * from \"~/components/AdminLayout.js\";\nexport * from \"~/components/Buttons/index.js\";\nexport { DialogsProvider } from \"~/components/Dialogs/DialogsContext.js\";\nexport * from \"~/components/OptionsMenu/index.js\";\nexport * from \"~/components/Filters/index.js\";\nexport * from \"~/components/BulkActions/index.js\";\nexport { OverlayLayout, type OverlayLayoutProps } from \"~/components/OverlayLayout/index.js\";\nexport { type EmptyViewProps, EmptyView } from \"~/components/EmptyView.js\";\nexport {\n SimpleFormContent,\n SimpleForm,\n SimpleFormFooter,\n SimpleFormHeader\n} from \"~/components/SimpleForm/index.js\";\nexport {\n default as SingleImageUpload,\n type SingleImageUploadProps\n} from \"~/components/SingleImageUpload.js\";\nexport { LexicalEditor } from \"~/components/LexicalEditor/index.js\";\nexport type { RichTextValueWithHtml } from \"~/components/LexicalEditor/index.js\";\nexport { LexicalLinkForm } from \"~/components/LexicalEditor/index.js\";\nexport { Wcp } from \"~/components/Wcp.js\";\nexport * from \"~/components/IconPicker/index.js\";\nexport * from \"~/components/NavigationPrompt.js\";\nexport * from \"~/components/SplitView/index.js\";\nexport * from \"~/components/Permissions/index.js\";\nexport * from \"~/components/SearchUI.js\";\nexport * from \"~/components/RegisterFeature.js\";\nexport { RegisterFeature } from \"~/components/RegisterFeature.js\";\nexport * from \"~/components/RolesMultiAutocomplete/index.js\";\nexport * from \"~/components/RoleAutocomplete/index.js\";\nexport * from \"~/components/TeamAutocomplete/index.js\";\nexport * from \"~/components/TeamsMultiAutocomplete/index.js\";\nexport * from \"./DeveloperMode/index.js\";\n"],"mappings":"AAAA,SAASA,WAAW;AACpB,SAASC,aAAa;AACtB,SAASC,cAAc;AACvB,SAASC,gBAAgB;AACzB;AACA;AACA,SAASC,eAAe;AACxB;AACA;AACA;AACA,SAASC,aAAa;AACtB,SAA8BC,SAAS;AACvC,SACIC,iBAAiB,EACjBC,UAAU,EACVC,gBAAgB,EAChBC,gBAAgB;AAEpB,SACIC,OAAO,IAAIC,iBAAiB;AAGhC,SAASC,aAAa;AAEtB,SAASC,eAAe;AACxB,SAASC,GAAG;AACZ;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,eAAe;AACxB;AACA;AACA;AACA;AACA","ignoreList":[]}
|
package/exports/admin/ui.d.ts
CHANGED
package/exports/admin/ui.js
CHANGED
package/exports/admin/ui.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Logo","TenantSelector","LexicalEditor"],"sources":["ui.ts"],"sourcesContent":["export { Logo } from \"~/base/ui/Logo.js\";\nexport { TenantSelector } from \"~/base/ui/TenantSelector.js\";\nexport { LexicalEditor } from \"~/components/LexicalEditor/LexicalEditor.js\";\n"],"mappings":"AAAA,SAASA,IAAI;AACb,SAASC,cAAc;AACvB,SAASC,aAAa","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["useDialogs","Logo","TenantSelector","LexicalEditor"],"sources":["ui.ts"],"sourcesContent":["export { useDialogs } from \"~/components/Dialogs/useDialogs.js\";\nexport { Logo } from \"~/base/ui/Logo.js\";\nexport { TenantSelector } from \"~/base/ui/TenantSelector.js\";\nexport { LexicalEditor } from \"~/components/LexicalEditor/LexicalEditor.js\";\n"],"mappings":"AAAA,SAASA,UAAU;AACnB,SAASC,IAAI;AACb,SAASC,cAAc;AACvB,SAASC,aAAa","ignoreList":[]}
|
|
@@ -9,6 +9,7 @@ export declare class ReactLicense implements ILicense {
|
|
|
9
9
|
canUseFeature(featureId: keyof typeof WCP_FEATURE_LABEL): boolean;
|
|
10
10
|
canUseFileManagerThreatDetection(): boolean;
|
|
11
11
|
canUseFolderLevelPermissions(): boolean;
|
|
12
|
+
canUseHcmsFieldPermissions(): boolean;
|
|
12
13
|
canUsePrivateFiles(): boolean;
|
|
13
14
|
canUseRecordLocking(): boolean;
|
|
14
15
|
canUseTeams(): boolean;
|
|
@@ -20,6 +20,9 @@ export class ReactLicense {
|
|
|
20
20
|
canUseFolderLevelPermissions() {
|
|
21
21
|
return this.license.canUseFolderLevelPermissions();
|
|
22
22
|
}
|
|
23
|
+
canUseHcmsFieldPermissions() {
|
|
24
|
+
return this.license.canUseHcmsFieldPermissions();
|
|
25
|
+
}
|
|
23
26
|
canUsePrivateFiles() {
|
|
24
27
|
return this.license.canUsePrivateFiles();
|
|
25
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ReactLicense","constructor","license","getProject","canUseAacl","canUseAuditLogs","canUseFeature","featureId","canUseFileManagerThreatDetection","canUseFolderLevelPermissions","canUsePrivateFiles","canUseRecordLocking","canUseTeams","getRawLicense","canUseWorkflows","toDto"],"sources":["ReactLicense.ts"],"sourcesContent":["import type { DecryptedWcpProjectLicense, ILicense, WcpProject } from \"@webiny/wcp/types.js\";\nimport type { WCP_FEATURE_LABEL } from \"@webiny/wcp\";\n\nexport class ReactLicense implements ILicense {\n private readonly license: ILicense;\n\n constructor(license: ILicense) {\n this.license = license;\n }\n\n getProject(): WcpProject | null {\n return this.license.getProject();\n }\n\n canUseAacl(): boolean {\n return this.license.canUseAacl();\n }\n\n canUseAuditLogs(): boolean {\n return this.license.canUseAuditLogs();\n }\n\n canUseFeature(featureId: keyof typeof WCP_FEATURE_LABEL): boolean {\n return this.license.canUseFeature(featureId);\n }\n\n canUseFileManagerThreatDetection(): boolean {\n return this.license.canUseFileManagerThreatDetection();\n }\n\n canUseFolderLevelPermissions(): boolean {\n return this.license.canUseFolderLevelPermissions();\n }\n\n canUsePrivateFiles(): boolean {\n return this.license.canUsePrivateFiles();\n }\n\n canUseRecordLocking(): boolean {\n return this.license.canUseRecordLocking();\n }\n\n canUseTeams(): boolean {\n return this.license.canUseTeams();\n }\n\n getRawLicense(): DecryptedWcpProjectLicense | null {\n return this.license.getRawLicense();\n }\n\n public canUseWorkflows(): boolean {\n return this.license.canUseWorkflows();\n }\n\n toDto(): DecryptedWcpProjectLicense | null {\n return this.license.toDto();\n }\n}\n"],"mappings":"AAGA,OAAO,MAAMA,YAAY,CAAqB;EAG1CC,WAAWA,CAACC,OAAiB,EAAE;IAC3B,IAAI,CAACA,OAAO,GAAGA,OAAO;EAC1B;EAEAC,UAAUA,CAAA,EAAsB;IAC5B,OAAO,IAAI,CAACD,OAAO,CAACC,UAAU,CAAC,CAAC;EACpC;EAEAC,UAAUA,CAAA,EAAY;IAClB,OAAO,IAAI,CAACF,OAAO,CAACE,UAAU,CAAC,CAAC;EACpC;EAEAC,eAAeA,CAAA,EAAY;IACvB,OAAO,IAAI,CAACH,OAAO,CAACG,eAAe,CAAC,CAAC;EACzC;EAEAC,aAAaA,CAACC,SAAyC,EAAW;IAC9D,OAAO,IAAI,CAACL,OAAO,CAACI,aAAa,CAACC,SAAS,CAAC;EAChD;EAEAC,gCAAgCA,CAAA,EAAY;IACxC,OAAO,IAAI,CAACN,OAAO,CAACM,gCAAgC,CAAC,CAAC;EAC1D;EAEAC,4BAA4BA,CAAA,EAAY;IACpC,OAAO,IAAI,CAACP,OAAO,CAACO,4BAA4B,CAAC,CAAC;EACtD;EAEAC,
|
|
1
|
+
{"version":3,"names":["ReactLicense","constructor","license","getProject","canUseAacl","canUseAuditLogs","canUseFeature","featureId","canUseFileManagerThreatDetection","canUseFolderLevelPermissions","canUseHcmsFieldPermissions","canUsePrivateFiles","canUseRecordLocking","canUseTeams","getRawLicense","canUseWorkflows","toDto"],"sources":["ReactLicense.ts"],"sourcesContent":["import type { DecryptedWcpProjectLicense, ILicense, WcpProject } from \"@webiny/wcp/types.js\";\nimport type { WCP_FEATURE_LABEL } from \"@webiny/wcp\";\n\nexport class ReactLicense implements ILicense {\n private readonly license: ILicense;\n\n constructor(license: ILicense) {\n this.license = license;\n }\n\n getProject(): WcpProject | null {\n return this.license.getProject();\n }\n\n canUseAacl(): boolean {\n return this.license.canUseAacl();\n }\n\n canUseAuditLogs(): boolean {\n return this.license.canUseAuditLogs();\n }\n\n canUseFeature(featureId: keyof typeof WCP_FEATURE_LABEL): boolean {\n return this.license.canUseFeature(featureId);\n }\n\n canUseFileManagerThreatDetection(): boolean {\n return this.license.canUseFileManagerThreatDetection();\n }\n\n canUseFolderLevelPermissions(): boolean {\n return this.license.canUseFolderLevelPermissions();\n }\n\n canUseHcmsFieldPermissions(): boolean {\n return this.license.canUseHcmsFieldPermissions();\n }\n\n canUsePrivateFiles(): boolean {\n return this.license.canUsePrivateFiles();\n }\n\n canUseRecordLocking(): boolean {\n return this.license.canUseRecordLocking();\n }\n\n canUseTeams(): boolean {\n return this.license.canUseTeams();\n }\n\n getRawLicense(): DecryptedWcpProjectLicense | null {\n return this.license.getRawLicense();\n }\n\n public canUseWorkflows(): boolean {\n return this.license.canUseWorkflows();\n }\n\n toDto(): DecryptedWcpProjectLicense | null {\n return this.license.toDto();\n }\n}\n"],"mappings":"AAGA,OAAO,MAAMA,YAAY,CAAqB;EAG1CC,WAAWA,CAACC,OAAiB,EAAE;IAC3B,IAAI,CAACA,OAAO,GAAGA,OAAO;EAC1B;EAEAC,UAAUA,CAAA,EAAsB;IAC5B,OAAO,IAAI,CAACD,OAAO,CAACC,UAAU,CAAC,CAAC;EACpC;EAEAC,UAAUA,CAAA,EAAY;IAClB,OAAO,IAAI,CAACF,OAAO,CAACE,UAAU,CAAC,CAAC;EACpC;EAEAC,eAAeA,CAAA,EAAY;IACvB,OAAO,IAAI,CAACH,OAAO,CAACG,eAAe,CAAC,CAAC;EACzC;EAEAC,aAAaA,CAACC,SAAyC,EAAW;IAC9D,OAAO,IAAI,CAACL,OAAO,CAACI,aAAa,CAACC,SAAS,CAAC;EAChD;EAEAC,gCAAgCA,CAAA,EAAY;IACxC,OAAO,IAAI,CAACN,OAAO,CAACM,gCAAgC,CAAC,CAAC;EAC1D;EAEAC,4BAA4BA,CAAA,EAAY;IACpC,OAAO,IAAI,CAACP,OAAO,CAACO,4BAA4B,CAAC,CAAC;EACtD;EAEAC,0BAA0BA,CAAA,EAAY;IAClC,OAAO,IAAI,CAACR,OAAO,CAACQ,0BAA0B,CAAC,CAAC;EACpD;EAEAC,kBAAkBA,CAAA,EAAY;IAC1B,OAAO,IAAI,CAACT,OAAO,CAACS,kBAAkB,CAAC,CAAC;EAC5C;EAEAC,mBAAmBA,CAAA,EAAY;IAC3B,OAAO,IAAI,CAACV,OAAO,CAACU,mBAAmB,CAAC,CAAC;EAC7C;EAEAC,WAAWA,CAAA,EAAY;IACnB,OAAO,IAAI,CAACX,OAAO,CAACW,WAAW,CAAC,CAAC;EACrC;EAEAC,aAAaA,CAAA,EAAsC;IAC/C,OAAO,IAAI,CAACZ,OAAO,CAACY,aAAa,CAAC,CAAC;EACvC;EAEOC,eAAeA,CAAA,EAAY;IAC9B,OAAO,IAAI,CAACb,OAAO,CAACa,eAAe,CAAC,CAAC;EACzC;EAEAC,KAAKA,CAAA,EAAsC;IACvC,OAAO,IAAI,CAACd,OAAO,CAACc,KAAK,CAAC,CAAC;EAC/B;AACJ","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/app-admin",
|
|
3
|
-
"version": "6.0.0-rc.
|
|
3
|
+
"version": "6.0.0-rc.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"description": "A collection of plugins that together form a complete admin interface, customizable and extensible with Webiny apps and plugins.",
|
|
@@ -15,29 +15,28 @@
|
|
|
15
15
|
"@apollo/react-hooks": "3.1.5",
|
|
16
16
|
"@emotion/react": "11.10.8",
|
|
17
17
|
"@emotion/styled": "11.10.6",
|
|
18
|
-
"@iconify/json": "2.2.
|
|
18
|
+
"@iconify/json": "2.2.445",
|
|
19
19
|
"@monaco-editor/react": "4.7.0",
|
|
20
20
|
"@svgr/webpack": "6.5.1",
|
|
21
21
|
"@types/mime": "2.0.3",
|
|
22
22
|
"@types/react": "18.2.79",
|
|
23
|
-
"@webiny/admin-ui": "6.0.0-rc.
|
|
24
|
-
"@webiny/app": "6.0.0-rc.
|
|
23
|
+
"@webiny/admin-ui": "6.0.0-rc.3",
|
|
24
|
+
"@webiny/app": "6.0.0-rc.3",
|
|
25
25
|
"@webiny/di": "0.2.3",
|
|
26
|
-
"@webiny/feature": "6.0.0-rc.
|
|
27
|
-
"@webiny/form": "6.0.0-rc.
|
|
28
|
-
"@webiny/icons": "6.0.0-rc.
|
|
29
|
-
"@webiny/lexical-converter": "6.0.0-rc.
|
|
30
|
-
"@webiny/lexical-editor": "6.0.0-rc.
|
|
31
|
-
"@webiny/lexical-theme": "6.0.0-rc.
|
|
32
|
-
"@webiny/plugins": "6.0.0-rc.
|
|
33
|
-
"@webiny/
|
|
34
|
-
"@webiny/react-
|
|
35
|
-
"@webiny/
|
|
36
|
-
"@webiny/
|
|
37
|
-
"@webiny/
|
|
38
|
-
"@webiny/
|
|
39
|
-
"@webiny/
|
|
40
|
-
"@webiny/wcp": "6.0.0-rc.1",
|
|
26
|
+
"@webiny/feature": "6.0.0-rc.3",
|
|
27
|
+
"@webiny/form": "6.0.0-rc.3",
|
|
28
|
+
"@webiny/icons": "6.0.0-rc.3",
|
|
29
|
+
"@webiny/lexical-converter": "6.0.0-rc.3",
|
|
30
|
+
"@webiny/lexical-editor": "6.0.0-rc.3",
|
|
31
|
+
"@webiny/lexical-theme": "6.0.0-rc.3",
|
|
32
|
+
"@webiny/plugins": "6.0.0-rc.3",
|
|
33
|
+
"@webiny/react-composition": "6.0.0-rc.3",
|
|
34
|
+
"@webiny/react-properties": "6.0.0-rc.3",
|
|
35
|
+
"@webiny/telemetry": "6.0.0-rc.3",
|
|
36
|
+
"@webiny/ui": "6.0.0-rc.3",
|
|
37
|
+
"@webiny/utils": "6.0.0-rc.3",
|
|
38
|
+
"@webiny/validation": "6.0.0-rc.3",
|
|
39
|
+
"@webiny/wcp": "6.0.0-rc.3",
|
|
41
40
|
"apollo-cache": "1.3.5",
|
|
42
41
|
"apollo-client": "2.6.10",
|
|
43
42
|
"apollo-link": "1.2.14",
|
|
@@ -45,13 +44,13 @@
|
|
|
45
44
|
"apollo-utilities": "1.3.4",
|
|
46
45
|
"classnames": "2.5.1",
|
|
47
46
|
"emotion": "10.0.27",
|
|
48
|
-
"graphql": "16.
|
|
47
|
+
"graphql": "16.13.0",
|
|
49
48
|
"graphql-tag": "2.12.6",
|
|
50
49
|
"history": "5.3.0",
|
|
51
50
|
"is-hotkey": "0.2.0",
|
|
52
51
|
"lodash": "4.17.23",
|
|
53
|
-
"markdown-to-jsx": "9.7.
|
|
54
|
-
"minimatch": "10.2.
|
|
52
|
+
"markdown-to-jsx": "9.7.6",
|
|
53
|
+
"minimatch": "10.2.4",
|
|
55
54
|
"mobx": "6.15.0",
|
|
56
55
|
"mobx-react-lite": "3.4.3",
|
|
57
56
|
"monaco-editor": "0.53.0",
|
|
@@ -60,14 +59,12 @@
|
|
|
60
59
|
"react-dom": "18.2.0",
|
|
61
60
|
"react-draggable": "4.5.0",
|
|
62
61
|
"react-resizable": "3.1.3",
|
|
63
|
-
"react-resizable-panels": "4.
|
|
62
|
+
"react-resizable-panels": "4.7.0",
|
|
64
63
|
"react-transition-group": "4.4.5",
|
|
65
64
|
"react-virtualized": "9.22.6",
|
|
66
65
|
"reset-css": "5.0.2",
|
|
67
66
|
"tinycolor2": "1.6.0",
|
|
68
|
-
"
|
|
69
|
-
"unicode-emoji-json": "0.8.0",
|
|
70
|
-
"zod": "3.25.76"
|
|
67
|
+
"unicode-emoji-json": "0.8.0"
|
|
71
68
|
},
|
|
72
69
|
"devDependencies": {
|
|
73
70
|
"@emotion/babel-plugin": "11.13.5",
|
|
@@ -79,7 +76,7 @@
|
|
|
79
76
|
"@types/react-transition-group": "4.4.12",
|
|
80
77
|
"@types/store": "2.0.5",
|
|
81
78
|
"@types/tinycolor2": "1.4.6",
|
|
82
|
-
"@webiny/build-tools": "6.0.0-rc.
|
|
79
|
+
"@webiny/build-tools": "6.0.0-rc.3",
|
|
83
80
|
"rimraf": "6.1.3",
|
|
84
81
|
"typescript": "5.9.3",
|
|
85
82
|
"vitest": "4.0.18"
|
|
@@ -105,5 +102,5 @@
|
|
|
105
102
|
]
|
|
106
103
|
}
|
|
107
104
|
},
|
|
108
|
-
"gitHead": "
|
|
105
|
+
"gitHead": "228fe25e1a17f248d566bce1c33d11c291955513"
|
|
109
106
|
}
|
|
@@ -7,6 +7,7 @@ import { usePermissionValue } from "./PermissionValueContext.js";
|
|
|
7
7
|
import { useAuthentication } from "../exports/admin/security.js";
|
|
8
8
|
const NO_ACCESS = "no";
|
|
9
9
|
const FULL_ACCESS = "full";
|
|
10
|
+
const READ_ONLY_ACCESS = "read-only";
|
|
10
11
|
const CUSTOM_ACCESS = "custom";
|
|
11
12
|
const RWD_OPTIONS = [{
|
|
12
13
|
value: "r",
|
|
@@ -92,7 +93,7 @@ function EntitySection({
|
|
|
92
93
|
if (hasAction(entity, "rwd")) {
|
|
93
94
|
columns.push(/*#__PURE__*/React.createElement(Grid.Column, {
|
|
94
95
|
span: 12,
|
|
95
|
-
key: "
|
|
96
|
+
key: "rwd"
|
|
96
97
|
}, /*#__PURE__*/React.createElement(Bind, {
|
|
97
98
|
name: `${entity.id}RWD`
|
|
98
99
|
}, /*#__PURE__*/React.createElement(Select, {
|
|
@@ -157,22 +158,29 @@ export const PermissionRenderer = ({
|
|
|
157
158
|
});
|
|
158
159
|
const entities = schema.entities || [];
|
|
159
160
|
const hasEntities = entities.length > 0;
|
|
160
|
-
const accessLevelOptions =
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
161
|
+
const accessLevelOptions = useMemo(() => {
|
|
162
|
+
const options = [{
|
|
163
|
+
value: NO_ACCESS,
|
|
164
|
+
label: "No access"
|
|
165
|
+
}];
|
|
166
|
+
if (schema.readOnlyAccess) {
|
|
167
|
+
options.push({
|
|
168
|
+
value: READ_ONLY_ACCESS,
|
|
169
|
+
label: "Read-only access"
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
options.push({
|
|
173
|
+
value: FULL_ACCESS,
|
|
174
|
+
label: "Full access"
|
|
175
|
+
});
|
|
176
|
+
if (hasEntities) {
|
|
177
|
+
options.push({
|
|
178
|
+
value: CUSTOM_ACCESS,
|
|
179
|
+
label: "Custom access"
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
return options;
|
|
183
|
+
}, [schema, hasEntities]);
|
|
176
184
|
return /*#__PURE__*/React.createElement(Form, {
|
|
177
185
|
data: formData,
|
|
178
186
|
onChange: onFormChange
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Fragment","useCallback","useMemo","CheckboxGroup","Grid","Select","Form","CannotUseAaclAlert","PermissionInfo","PermissionsGroup","usePermissionForm","usePermissionValue","useAuthentication","NO_ACCESS","FULL_ACCESS","CUSTOM_ACCESS","RWD_OPTIONS","value","label","PW_OPTIONS","hasAction","entity","name","actions","some","a","buildScopeOptions","options","scopes","includes","push","BUILTIN_ACTIONS","Set","getCustomActions","filter","has","EntitySection","data","cannotUseAAcl","Bind","setValue","scopeField","id","currentScope","scopeDisabled","customActions","customActionsValue","map","onCustomActionsChange","selected","selectedSet","action","columns","createElement","Column","span","key","beforeChange","cb","disabled","description","items","opt","length","onChange","title","PermissionRenderer","schema","identity","getPermission","formData","onFormChange","entities","hasEntities","accessLevelOptions","className","accessLevel"],"sources":["PermissionRenderer.tsx"],"sourcesContent":["import React, { Fragment, useCallback, useMemo } from \"react\";\nimport { CheckboxGroup, Grid, Select } from \"@webiny/admin-ui\";\nimport { Form } from \"@webiny/form\";\nimport type { BindComponent } from \"@webiny/form\";\nimport {\n CannotUseAaclAlert,\n PermissionInfo,\n PermissionsGroup\n} from \"../components/Permissions/index.js\";\nimport { usePermissionForm } from \"./usePermissionForm.js\";\nimport type { AaclPermission } from \"../features/wcp/types.js\";\nimport type { ActionDefinition, PermissionSchema, EntityDefinition } from \"./types.js\";\nimport { usePermissionValue } from \"./PermissionValueContext.js\";\nimport { useAuthentication } from \"~/exports/admin/security.js\";\n\nexport interface PermissionRendererProps {\n schema: PermissionSchema;\n}\n\nconst NO_ACCESS = \"no\";\nconst FULL_ACCESS = \"full\";\nconst CUSTOM_ACCESS = \"custom\";\n\nconst RWD_OPTIONS = [\n { value: \"r\", label: \"Read\" },\n { value: \"rw\", label: \"Read, write\" },\n { value: \"rwd\", label: \"Read, write, delete\" }\n];\n\nconst PW_OPTIONS = [\n { value: \"p\", label: \"Publish\" },\n { value: \"u\", label: \"Unpublish\" }\n];\n\nfunction hasAction(entity: EntityDefinition, name: string): boolean {\n return entity.actions?.some(a => a.name === name) ?? false;\n}\n\nfunction buildScopeOptions(entity: EntityDefinition) {\n const options = [{ value: NO_ACCESS, label: \"No access\" }];\n\n if (entity.scopes.includes(\"full\")) {\n options.push({ value: FULL_ACCESS, label: \"Full access\" });\n }\n\n if (entity.scopes.includes(\"own\")) {\n options.push({ value: \"own\", label: \"Only entries created by the user\" });\n }\n\n return options;\n}\n\nconst BUILTIN_ACTIONS = new Set([\"rwd\", \"pw\"]);\n\nfunction getCustomActions(entity: EntityDefinition): ActionDefinition[] {\n return (entity.actions ?? []).filter(a => !BUILTIN_ACTIONS.has(a.name));\n}\n\ninterface EntitySectionProps {\n entity: EntityDefinition;\n data: Record<string, any>;\n cannotUseAAcl: boolean;\n Bind: BindComponent;\n setValue: (name: string, value: any) => void;\n}\n\nfunction EntitySection({ entity, data, cannotUseAAcl, Bind, setValue }: EntitySectionProps) {\n const scopeField = `${entity.id}AccessScope`;\n const currentScope = data[scopeField];\n const scopeDisabled = cannotUseAAcl || !currentScope || currentScope === NO_ACCESS;\n const customActions = useMemo(() => getCustomActions(entity), [entity]);\n\n // Derive the selected values array from individual boolean form fields.\n const customActionsValue = useMemo(() => {\n return customActions.filter(a => data[`${entity.id}Action_${a.name}`]).map(a => a.name);\n }, [data, customActions, entity.id]);\n\n const onCustomActionsChange = useCallback(\n (selected: string[]) => {\n const selectedSet = new Set(selected);\n for (const action of customActions) {\n setValue(`${entity.id}Action_${action.name}`, selectedSet.has(action.name));\n }\n },\n [customActions, entity.id, setValue]\n );\n\n const columns = [\n <Grid.Column span={12} key={\"access\"}>\n <Bind\n name={scopeField}\n beforeChange={(value: string, cb: (v: string) => void) => {\n if (value === \"own\" && hasAction(entity, \"rwd\")) {\n setValue(`${entity.id}RWD`, \"rwd\");\n }\n cb(value);\n }}\n >\n <Select\n label={\"Access Scope\"}\n disabled={cannotUseAAcl}\n options={buildScopeOptions(entity)}\n />\n </Bind>\n </Grid.Column>\n ];\n\n if (hasAction(entity, \"rwd\")) {\n columns.push(\n <Grid.Column span={12} key={\"pw\"}>\n <Bind name={`${entity.id}RWD`}>\n <Select\n label={\"Primary Actions\"}\n disabled={scopeDisabled || currentScope === \"own\"}\n options={RWD_OPTIONS}\n />\n </Bind>\n </Grid.Column>\n );\n }\n\n if (hasAction(entity, \"pw\")) {\n columns.push(\n <Grid.Column span={12} key={\"pw\"}>\n <Bind name={`${entity.id}PW`}>\n <CheckboxGroup\n label={\"Publishing actions\"}\n description={\"Publishing-related actions that can be performed on entries.\"}\n items={PW_OPTIONS.map(opt => ({\n ...opt,\n disabled: scopeDisabled\n }))}\n />\n </Bind>\n </Grid.Column>\n );\n }\n\n if (customActions.length > 0) {\n columns.push(\n <Grid.Column span={12} key={\"other\"}>\n <CheckboxGroup\n label={\"Other Actions\"}\n value={customActionsValue}\n onChange={onCustomActionsChange}\n items={customActions.map(action => ({\n value: action.name,\n label: action.label || action.name,\n disabled: scopeDisabled\n }))}\n />\n </Grid.Column>\n );\n }\n\n return (\n <PermissionsGroup title={entity.title || entity.id}>\n <Grid>{columns}</Grid>\n </PermissionsGroup>\n );\n}\n\nexport const PermissionRenderer = ({ schema }: PermissionRendererProps) => {\n const { value, onChange } = usePermissionValue();\n const { identity } = useAuthentication();\n\n const cannotUseAAcl = useMemo(() => {\n return !identity.getPermission<AaclPermission>(\"aacl\", true);\n }, []);\n\n const { formData, onFormChange } = usePermissionForm(schema, { value, onChange });\n\n const entities = schema.entities || [];\n const hasEntities = entities.length > 0;\n\n const accessLevelOptions = hasEntities\n ? [\n { value: NO_ACCESS, label: \"No access\" },\n { value: FULL_ACCESS, label: \"Full access\" },\n { value: CUSTOM_ACCESS, label: \"Custom access\" }\n ]\n : [\n { value: NO_ACCESS, label: \"No access\" },\n { value: FULL_ACCESS, label: \"Full access\" }\n ];\n\n return (\n <Form data={formData} onChange={onFormChange}>\n {({ data, Bind, setValue }) => (\n <Fragment>\n <Grid className={\"pt-md\"}>\n <Grid.Column span={12}>\n {data.accessLevel === CUSTOM_ACCESS && cannotUseAAcl && (\n <CannotUseAaclAlert />\n )}\n </Grid.Column>\n </Grid>\n <Grid className={\"pt-md\"}>\n <Grid.Column span={6}>\n <PermissionInfo title={\"Access Level\"} />\n </Grid.Column>\n <Grid.Column span={6}>\n <Bind name={\"accessLevel\"}>\n <Select options={accessLevelOptions} />\n </Bind>\n </Grid.Column>\n </Grid>\n {data.accessLevel === CUSTOM_ACCESS && hasEntities && (\n <div className={\"mt-lg\"}>\n {entities.map(entity => (\n <EntitySection\n key={entity.id}\n entity={entity}\n data={data}\n cannotUseAAcl={cannotUseAAcl}\n Bind={Bind}\n setValue={setValue}\n />\n ))}\n </div>\n )}\n </Fragment>\n )}\n </Form>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,WAAW,EAAEC,OAAO,QAAQ,OAAO;AAC7D,SAASC,aAAa,EAAEC,IAAI,EAAEC,MAAM,QAAQ,kB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CACtB,CACJ,CACA,CAEH,CAEZ,CAAC;AAEf,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","Fragment","useCallback","useMemo","CheckboxGroup","Grid","Select","Form","CannotUseAaclAlert","PermissionInfo","PermissionsGroup","usePermissionForm","usePermissionValue","useAuthentication","NO_ACCESS","FULL_ACCESS","READ_ONLY_ACCESS","CUSTOM_ACCESS","RWD_OPTIONS","value","label","PW_OPTIONS","hasAction","entity","name","actions","some","a","buildScopeOptions","options","scopes","includes","push","BUILTIN_ACTIONS","Set","getCustomActions","filter","has","EntitySection","data","cannotUseAAcl","Bind","setValue","scopeField","id","currentScope","scopeDisabled","customActions","customActionsValue","map","onCustomActionsChange","selected","selectedSet","action","columns","createElement","Column","span","key","beforeChange","cb","disabled","description","items","opt","length","onChange","title","PermissionRenderer","schema","identity","getPermission","formData","onFormChange","entities","hasEntities","accessLevelOptions","readOnlyAccess","className","accessLevel"],"sources":["PermissionRenderer.tsx"],"sourcesContent":["import React, { Fragment, useCallback, useMemo } from \"react\";\nimport { CheckboxGroup, Grid, Select } from \"@webiny/admin-ui\";\nimport { Form } from \"@webiny/form\";\nimport type { BindComponent } from \"@webiny/form\";\nimport {\n CannotUseAaclAlert,\n PermissionInfo,\n PermissionsGroup\n} from \"../components/Permissions/index.js\";\nimport { usePermissionForm } from \"./usePermissionForm.js\";\nimport type { AaclPermission } from \"../features/wcp/types.js\";\nimport type { ActionDefinition, PermissionSchema, EntityDefinition } from \"./types.js\";\nimport { usePermissionValue } from \"./PermissionValueContext.js\";\nimport { useAuthentication } from \"~/exports/admin/security.js\";\n\nexport interface PermissionRendererProps {\n schema: PermissionSchema;\n}\n\nconst NO_ACCESS = \"no\";\nconst FULL_ACCESS = \"full\";\nconst READ_ONLY_ACCESS = \"read-only\";\nconst CUSTOM_ACCESS = \"custom\";\n\nconst RWD_OPTIONS = [\n { value: \"r\", label: \"Read\" },\n { value: \"rw\", label: \"Read, write\" },\n { value: \"rwd\", label: \"Read, write, delete\" }\n];\n\nconst PW_OPTIONS = [\n { value: \"p\", label: \"Publish\" },\n { value: \"u\", label: \"Unpublish\" }\n];\n\nfunction hasAction(entity: EntityDefinition, name: string): boolean {\n return entity.actions?.some(a => a.name === name) ?? false;\n}\n\nfunction buildScopeOptions(entity: EntityDefinition) {\n const options = [{ value: NO_ACCESS, label: \"No access\" }];\n\n if (entity.scopes.includes(\"full\")) {\n options.push({ value: FULL_ACCESS, label: \"Full access\" });\n }\n\n if (entity.scopes.includes(\"own\")) {\n options.push({ value: \"own\", label: \"Only entries created by the user\" });\n }\n\n return options;\n}\n\nconst BUILTIN_ACTIONS = new Set([\"rwd\", \"pw\"]);\n\nfunction getCustomActions(entity: EntityDefinition): ActionDefinition[] {\n return (entity.actions ?? []).filter(a => !BUILTIN_ACTIONS.has(a.name));\n}\n\ninterface EntitySectionProps {\n entity: EntityDefinition;\n data: Record<string, any>;\n cannotUseAAcl: boolean;\n Bind: BindComponent;\n setValue: (name: string, value: any) => void;\n}\n\nfunction EntitySection({ entity, data, cannotUseAAcl, Bind, setValue }: EntitySectionProps) {\n const scopeField = `${entity.id}AccessScope`;\n const currentScope = data[scopeField];\n const scopeDisabled = cannotUseAAcl || !currentScope || currentScope === NO_ACCESS;\n const customActions = useMemo(() => getCustomActions(entity), [entity]);\n\n // Derive the selected values array from individual boolean form fields.\n const customActionsValue = useMemo(() => {\n return customActions.filter(a => data[`${entity.id}Action_${a.name}`]).map(a => a.name);\n }, [data, customActions, entity.id]);\n\n const onCustomActionsChange = useCallback(\n (selected: string[]) => {\n const selectedSet = new Set(selected);\n for (const action of customActions) {\n setValue(`${entity.id}Action_${action.name}`, selectedSet.has(action.name));\n }\n },\n [customActions, entity.id, setValue]\n );\n\n const columns = [\n <Grid.Column span={12} key={\"access\"}>\n <Bind\n name={scopeField}\n beforeChange={(value: string, cb: (v: string) => void) => {\n if (value === \"own\" && hasAction(entity, \"rwd\")) {\n setValue(`${entity.id}RWD`, \"rwd\");\n }\n cb(value);\n }}\n >\n <Select\n label={\"Access Scope\"}\n disabled={cannotUseAAcl}\n options={buildScopeOptions(entity)}\n />\n </Bind>\n </Grid.Column>\n ];\n\n if (hasAction(entity, \"rwd\")) {\n columns.push(\n <Grid.Column span={12} key={\"rwd\"}>\n <Bind name={`${entity.id}RWD`}>\n <Select\n label={\"Primary Actions\"}\n disabled={scopeDisabled || currentScope === \"own\"}\n options={RWD_OPTIONS}\n />\n </Bind>\n </Grid.Column>\n );\n }\n\n if (hasAction(entity, \"pw\")) {\n columns.push(\n <Grid.Column span={12} key={\"pw\"}>\n <Bind name={`${entity.id}PW`}>\n <CheckboxGroup\n label={\"Publishing actions\"}\n description={\"Publishing-related actions that can be performed on entries.\"}\n items={PW_OPTIONS.map(opt => ({\n ...opt,\n disabled: scopeDisabled\n }))}\n />\n </Bind>\n </Grid.Column>\n );\n }\n\n if (customActions.length > 0) {\n columns.push(\n <Grid.Column span={12} key={\"other\"}>\n <CheckboxGroup\n label={\"Other Actions\"}\n value={customActionsValue}\n onChange={onCustomActionsChange}\n items={customActions.map(action => ({\n value: action.name,\n label: action.label || action.name,\n disabled: scopeDisabled\n }))}\n />\n </Grid.Column>\n );\n }\n\n return (\n <PermissionsGroup title={entity.title || entity.id}>\n <Grid>{columns}</Grid>\n </PermissionsGroup>\n );\n}\n\nexport const PermissionRenderer = ({ schema }: PermissionRendererProps) => {\n const { value, onChange } = usePermissionValue();\n const { identity } = useAuthentication();\n\n const cannotUseAAcl = useMemo(() => {\n return !identity.getPermission<AaclPermission>(\"aacl\", true);\n }, []);\n\n const { formData, onFormChange } = usePermissionForm(schema, { value, onChange });\n\n const entities = schema.entities || [];\n const hasEntities = entities.length > 0;\n\n const accessLevelOptions = useMemo(() => {\n const options = [{ value: NO_ACCESS, label: \"No access\" }];\n\n if (schema.readOnlyAccess) {\n options.push({ value: READ_ONLY_ACCESS, label: \"Read-only access\" });\n }\n\n options.push({ value: FULL_ACCESS, label: \"Full access\" });\n\n if (hasEntities) {\n options.push({ value: CUSTOM_ACCESS, label: \"Custom access\" });\n }\n\n return options;\n }, [schema, hasEntities]);\n\n return (\n <Form data={formData} onChange={onFormChange}>\n {({ data, Bind, setValue }) => (\n <Fragment>\n <Grid className={\"pt-md\"}>\n <Grid.Column span={12}>\n {data.accessLevel === CUSTOM_ACCESS && cannotUseAAcl && (\n <CannotUseAaclAlert />\n )}\n </Grid.Column>\n </Grid>\n <Grid className={\"pt-md\"}>\n <Grid.Column span={6}>\n <PermissionInfo title={\"Access Level\"} />\n </Grid.Column>\n <Grid.Column span={6}>\n <Bind name={\"accessLevel\"}>\n <Select options={accessLevelOptions} />\n </Bind>\n </Grid.Column>\n </Grid>\n {data.accessLevel === CUSTOM_ACCESS && hasEntities && (\n <div className={\"mt-lg\"}>\n {entities.map(entity => (\n <EntitySection\n key={entity.id}\n entity={entity}\n data={data}\n cannotUseAAcl={cannotUseAAcl}\n Bind={Bind}\n setValue={setValue}\n />\n ))}\n </div>\n )}\n </Fragment>\n )}\n </Form>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,WAAW,EAAEC,OAAO,QAAQ,OAAO;AAC7D,SAASC,aAAa,EAAEC,IAAI,EAAEC,MAAM,QAAQ,kBAAkB;AAC9D,SAASC,IAAI,QAAQ,cAAc;AAEnC,SACIC,kBAAkB,EAClBC,cAAc,EACdC,gBAAgB;AAEpB,SAASC,iBAAiB;AAG1B,SAASC,kBAAkB;AAC3B,SAASC,iBAAiB;AAM1B,MAAMC,SAAS,GAAG,IAAI;AACtB,MAAMC,WAAW,GAAG,MAAM;AAC1B,MAAMC,gBAAgB,GAAG,WAAW;AACpC,MAAMC,aAAa,GAAG,QAAQ;AAE9B,MAAMC,WAAW,GAAG,CAChB;EAAEC,KAAK,EAAE,GAAG;EAAEC,KAAK,EAAE;AAAO,CAAC,EAC7B;EAAED,KAAK,EAAE,IAAI;EAAEC,KAAK,EAAE;AAAc,CAAC,EACrC;EAAED,KAAK,EAAE,KAAK;EA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CAACmD,MAAM;IAACC,IAAI,EAAE;EAAG,GACjBlB,IAAI,CAACwC,WAAW,KAAK9D,aAAa,IAAIuB,aAAa,iBAChDxC,KAAA,CAAAuD,aAAA,CAAC/C,kBAAkB,MAAE,CAEhB,CACX,CAAC,eACPR,KAAA,CAAAuD,aAAA,CAAClD,IAAI;IAACyE,SAAS,EAAE;EAAQ,gBACrB9E,KAAA,CAAAuD,aAAA,CAAClD,IAAI,CAACmD,MAAM;IAACC,IAAI,EAAE;EAAE,gBACjBzD,KAAA,CAAAuD,aAAA,CAAC9C,cAAc;IAAC0D,KAAK,EAAE;EAAe,CAAE,CAC/B,CAAC,eACdnE,KAAA,CAAAuD,aAAA,CAAClD,IAAI,CAACmD,MAAM;IAACC,IAAI,EAAE;EAAE,gBACjBzD,KAAA,CAAAuD,aAAA,CAACd,IAAI;IAACjB,IAAI,EAAE;EAAc,gBACtBxB,KAAA,CAAAuD,aAAA,CAACjD,MAAM;IAACuB,OAAO,EAAE+C;EAAmB,CAAE,CACpC,CACG,CACX,CAAC,EACNrC,IAAI,CAACwC,WAAW,KAAK9D,aAAa,IAAI0D,WAAW,iBAC9C3E,KAAA,CAAAuD,aAAA;IAAKuB,SAAS,EAAE;EAAQ,GACnBJ,QAAQ,CAACzB,GAAG,CAAC1B,MAAM,iBAChBvB,KAAA,CAAAuD,aAAA,CAACjB,aAAa;IACVoB,GAAG,EAAEnC,MAAM,CAACqB,EAAG;IACfrB,MAAM,EAAEA,MAAO;IACfgB,IAAI,EAAEA,IAAK;IACXC,aAAa,EAAEA,aAAc;IAC7BC,IAAI,EAAEA,IAAK;IACXC,QAAQ,EAAEA;EAAS,CACtB,CACJ,CACA,CAEH,CAEZ,CAAC;AAEf,CAAC","ignoreList":[]}
|
package/permissions/types.d.ts
CHANGED
|
@@ -50,11 +50,20 @@ export interface EntityDefinition {
|
|
|
50
50
|
export interface PermissionSchemaConfig {
|
|
51
51
|
/** Permission prefix — used to filter permissions from the array */
|
|
52
52
|
prefix: string;
|
|
53
|
-
/**
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
/**
|
|
54
|
+
* Full access configuration.
|
|
55
|
+
* - `true` — emits `{ name: "${prefix}.*" }`.
|
|
56
|
+
* - `{ ...extras }` — emits `{ name: "${prefix}.*", ...extras }`.
|
|
57
|
+
*/
|
|
58
|
+
fullAccess: boolean | {
|
|
56
59
|
[key: string]: any;
|
|
57
60
|
};
|
|
61
|
+
/**
|
|
62
|
+
* Read-only access configuration. When defined, the schema supports a read-only tier.
|
|
63
|
+
* - `true` — emits `{ name: "${prefix}.*", rwd: "r" }`.
|
|
64
|
+
* - `Permission[]` — emits the array as-is.
|
|
65
|
+
*/
|
|
66
|
+
readOnlyAccess?: boolean | Permission[];
|
|
58
67
|
/** Entity definitions (optional — simple apps have none) */
|
|
59
68
|
entities?: EntityDefinition[];
|
|
60
69
|
}
|
|
@@ -63,11 +72,20 @@ export interface PermissionSchemaConfig {
|
|
|
63
72
|
*/
|
|
64
73
|
export interface PermissionSchema {
|
|
65
74
|
prefix: string;
|
|
66
|
-
/**
|
|
67
|
-
|
|
68
|
-
|
|
75
|
+
/**
|
|
76
|
+
* Full access configuration.
|
|
77
|
+
* - `true` — emits `{ name: "${prefix}.*" }`.
|
|
78
|
+
* - `{ ...extras }` — emits `{ name: "${prefix}.*", ...extras }`.
|
|
79
|
+
*/
|
|
80
|
+
fullAccess: boolean | {
|
|
69
81
|
[key: string]: any;
|
|
70
82
|
};
|
|
83
|
+
/**
|
|
84
|
+
* Read-only access configuration. When defined, the schema supports a read-only tier.
|
|
85
|
+
* - `true` — emits `{ name: "${prefix}.*", rwd: "r" }`.
|
|
86
|
+
* - `Permission[]` — emits the array as-is.
|
|
87
|
+
*/
|
|
88
|
+
readOnlyAccess?: boolean | Permission[];
|
|
71
89
|
entities?: EntityDefinition[];
|
|
72
90
|
}
|
|
73
91
|
/**
|