@webiny/api-file-manager-aco 6.6.0-alpha.12 → 6.6.0-alpha.13
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/FileManagerAcoFeature.js +2 -0
- package/FileManagerAcoFeature.js.map +1 -1
- package/features/FmFolderPermissions/FmFolderPermissions.d.ts +14 -0
- package/features/FmFolderPermissions/FmFolderPermissions.js +26 -0
- package/features/FmFolderPermissions/FmFolderPermissions.js.map +1 -0
- package/package.json +19 -19
package/FileManagerAcoFeature.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { createFeature } from "@webiny/feature/api";
|
|
2
2
|
import { EnsureFolderIsEmptyBeforeDeleteFeature } from "./features/EnsureFolderIsEmptyBeforeDelete/feature.js";
|
|
3
|
+
import { FmFolderPermissions } from "./features/FmFolderPermissions/FmFolderPermissions.js";
|
|
3
4
|
const FileManagerAcoFeature = createFeature({
|
|
4
5
|
name: "FileManagerAco",
|
|
5
6
|
register (container) {
|
|
6
7
|
EnsureFolderIsEmptyBeforeDeleteFeature.register(container);
|
|
8
|
+
container.register(FmFolderPermissions);
|
|
7
9
|
}
|
|
8
10
|
});
|
|
9
11
|
export { FileManagerAcoFeature };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileManagerAcoFeature.js","sources":["../src/FileManagerAcoFeature.ts"],"sourcesContent":["import { type Container, createFeature } from \"@webiny/feature/api\";\nimport { EnsureFolderIsEmptyBeforeDeleteFeature } from \"./features/EnsureFolderIsEmptyBeforeDelete/feature.js\";\n\nexport const FileManagerAcoFeature = createFeature({\n name: \"FileManagerAco\",\n register(container: Container) {\n // Pure DI registration — no legacy ContextPlugin bridge needed.\n EnsureFolderIsEmptyBeforeDeleteFeature.register(container);\n }\n});\n"],"names":["FileManagerAcoFeature","createFeature","container","EnsureFolderIsEmptyBeforeDeleteFeature"],"mappings":"
|
|
1
|
+
{"version":3,"file":"FileManagerAcoFeature.js","sources":["../src/FileManagerAcoFeature.ts"],"sourcesContent":["import { type Container, createFeature } from \"@webiny/feature/api\";\nimport { EnsureFolderIsEmptyBeforeDeleteFeature } from \"./features/EnsureFolderIsEmptyBeforeDelete/feature.js\";\nimport { FmFolderPermissions } from \"./features/FmFolderPermissions/FmFolderPermissions.js\";\n\nexport const FileManagerAcoFeature = createFeature({\n name: \"FileManagerAco\",\n register(container: Container) {\n // Pure DI registration — no legacy ContextPlugin bridge needed.\n EnsureFolderIsEmptyBeforeDeleteFeature.register(container);\n // File Manager folders require File Manager file access.\n container.register(FmFolderPermissions);\n }\n});\n"],"names":["FileManagerAcoFeature","createFeature","container","EnsureFolderIsEmptyBeforeDeleteFeature","FmFolderPermissions"],"mappings":";;;AAIO,MAAMA,wBAAwBC,cAAc;IAC/C,MAAM;IACN,UAASC,SAAoB;QAEzBC,uCAAuC,QAAQ,CAACD;QAEhDA,UAAU,QAAQ,CAACE;IACvB;AACJ"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FolderTypePermissions } from "@webiny/api-aco/features/folder/FolderTypePermissions/index.js";
|
|
2
|
+
import { FmPermissions } from "@webiny/api-file-manager/features/shared/abstractions.js";
|
|
3
|
+
/** File Manager folders require File Manager file access. */
|
|
4
|
+
declare class FmFolderPermissionsImpl implements FolderTypePermissions.Interface {
|
|
5
|
+
private permissions;
|
|
6
|
+
constructor(permissions: FmPermissions.Interface);
|
|
7
|
+
canHandle(type: string): boolean;
|
|
8
|
+
canRead(): Promise<boolean>;
|
|
9
|
+
canWrite(): Promise<boolean>;
|
|
10
|
+
}
|
|
11
|
+
export declare const FmFolderPermissions: typeof FmFolderPermissionsImpl & {
|
|
12
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-aco/features/folder/FolderTypePermissions/abstractions").IFolderTypePermissions>;
|
|
13
|
+
};
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { FolderTypePermissions } from "@webiny/api-aco/features/folder/FolderTypePermissions/index.js";
|
|
2
|
+
import { FmPermissions } from "@webiny/api-file-manager/features/shared/abstractions.js";
|
|
3
|
+
const FM_FOLDER_TYPE = "FmFile";
|
|
4
|
+
class FmFolderPermissionsImpl {
|
|
5
|
+
constructor(permissions){
|
|
6
|
+
this.permissions = permissions;
|
|
7
|
+
}
|
|
8
|
+
canHandle(type) {
|
|
9
|
+
return type === FM_FOLDER_TYPE;
|
|
10
|
+
}
|
|
11
|
+
canRead() {
|
|
12
|
+
return this.permissions.canRead("file");
|
|
13
|
+
}
|
|
14
|
+
canWrite() {
|
|
15
|
+
return this.permissions.canEdit("file");
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
const FmFolderPermissions = FolderTypePermissions.createImplementation({
|
|
19
|
+
implementation: FmFolderPermissionsImpl,
|
|
20
|
+
dependencies: [
|
|
21
|
+
FmPermissions
|
|
22
|
+
]
|
|
23
|
+
});
|
|
24
|
+
export { FmFolderPermissions };
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=FmFolderPermissions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/FmFolderPermissions/FmFolderPermissions.js","sources":["../../../src/features/FmFolderPermissions/FmFolderPermissions.ts"],"sourcesContent":["import { FolderTypePermissions } from \"@webiny/api-aco/features/folder/FolderTypePermissions/index.js\";\nimport { FmPermissions } from \"@webiny/api-file-manager/features/shared/abstractions.js\";\n\nconst FM_FOLDER_TYPE = \"FmFile\";\n\n/** File Manager folders require File Manager file access. */\nclass FmFolderPermissionsImpl implements FolderTypePermissions.Interface {\n constructor(private permissions: FmPermissions.Interface) {}\n\n canHandle(type: string): boolean {\n return type === FM_FOLDER_TYPE;\n }\n\n canRead(): Promise<boolean> {\n return this.permissions.canRead(\"file\");\n }\n\n canWrite(): Promise<boolean> {\n return this.permissions.canEdit(\"file\");\n }\n}\n\nexport const FmFolderPermissions = FolderTypePermissions.createImplementation({\n implementation: FmFolderPermissionsImpl,\n dependencies: [FmPermissions]\n});\n"],"names":["FM_FOLDER_TYPE","FmFolderPermissionsImpl","permissions","type","FmFolderPermissions","FolderTypePermissions","FmPermissions"],"mappings":";;AAGA,MAAMA,iBAAiB;AAGvB,MAAMC;IACF,YAAoBC,WAAoC,CAAE;aAAtCA,WAAW,GAAXA;IAAuC;IAE3D,UAAUC,IAAY,EAAW;QAC7B,OAAOA,SAASH;IACpB;IAEA,UAA4B;QACxB,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC;IACpC;IAEA,WAA6B;QACzB,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC;IACpC;AACJ;AAEO,MAAMI,sBAAsBC,sBAAsB,oBAAoB,CAAC;IAC1E,gBAAgBJ;IAChB,cAAc;QAACK;KAAc;AACjC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/api-file-manager-aco",
|
|
3
|
-
"version": "6.6.0-alpha.
|
|
3
|
+
"version": "6.6.0-alpha.13",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./index.js",
|
|
@@ -21,28 +21,28 @@
|
|
|
21
21
|
"access": "public"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@webiny/api-aco": "6.6.0-alpha.
|
|
25
|
-
"@webiny/api-file-manager": "6.6.0-alpha.
|
|
26
|
-
"@webiny/api-graphql": "6.6.0-alpha.
|
|
27
|
-
"@webiny/error": "6.6.0-alpha.
|
|
28
|
-
"@webiny/feature": "6.6.0-alpha.
|
|
24
|
+
"@webiny/api-aco": "6.6.0-alpha.13",
|
|
25
|
+
"@webiny/api-file-manager": "6.6.0-alpha.13",
|
|
26
|
+
"@webiny/api-graphql": "6.6.0-alpha.13",
|
|
27
|
+
"@webiny/error": "6.6.0-alpha.13",
|
|
28
|
+
"@webiny/feature": "6.6.0-alpha.13"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@webiny/api": "6.6.0-alpha.
|
|
32
|
-
"@webiny/api-core": "6.6.0-alpha.
|
|
33
|
-
"@webiny/api-core-testing": "6.6.0-alpha.
|
|
34
|
-
"@webiny/api-graphql": "6.6.0-alpha.
|
|
35
|
-
"@webiny/api-headless-cms": "6.6.0-alpha.
|
|
36
|
-
"@webiny/
|
|
31
|
+
"@webiny/api": "6.6.0-alpha.13",
|
|
32
|
+
"@webiny/api-core": "6.6.0-alpha.13",
|
|
33
|
+
"@webiny/api-core-testing": "6.6.0-alpha.13",
|
|
34
|
+
"@webiny/api-graphql": "6.6.0-alpha.13",
|
|
35
|
+
"@webiny/api-headless-cms": "6.6.0-alpha.13",
|
|
36
|
+
"@webiny/api-kernel-core": "6.6.0-alpha.13",
|
|
37
|
+
"@webiny/build-tools": "6.6.0-alpha.13",
|
|
37
38
|
"@webiny/di": "2.0.0",
|
|
38
|
-
"@webiny/
|
|
39
|
-
"@webiny/
|
|
40
|
-
"@webiny/
|
|
41
|
-
"@webiny/
|
|
42
|
-
"
|
|
43
|
-
"graphql": "16.14.2",
|
|
39
|
+
"@webiny/handler": "6.6.0-alpha.13",
|
|
40
|
+
"@webiny/plugins": "6.6.0-alpha.13",
|
|
41
|
+
"@webiny/utils": "6.6.0-alpha.13",
|
|
42
|
+
"@webiny/wcp": "6.6.0-alpha.13",
|
|
43
|
+
"graphql": "16.15.0",
|
|
44
44
|
"typescript": "7.0.2",
|
|
45
|
-
"vitest": "5.
|
|
45
|
+
"vitest": "5.1.1"
|
|
46
46
|
},
|
|
47
47
|
"webiny": {
|
|
48
48
|
"publishFrom": "dist"
|