@aristid/leav-types 1.6.0-dce6fd17 → 1.6.0-e2820b2f
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/apps/core/config/default.d.ts +1 -0
- package/apps/core/src/__tests__/e2e/api/e2eUtils.d.ts +2 -0
- package/apps/core/src/__tests__/e2e/api/taskUtils.d.ts +4 -0
- package/apps/core/src/__tests__/e2e/api/trees/treeNodeChildrenQuery.test.d.ts +1 -0
- package/apps/core/src/__tests__/integration/infra/integrationTestRepoUtils.d.ts +2 -0
- package/apps/core/src/__tests__/integration/infra/permissionRepo.test.d.ts +1 -0
- package/apps/core/src/__tests__/mocks/attribute.d.ts +1 -0
- package/apps/core/src/_types/attribute.d.ts +5 -1
- package/apps/core/src/_types/config.d.ts +3 -1
- package/apps/core/src/_types/errors.d.ts +1 -0
- package/apps/core/src/_types/permissions.d.ts +24 -4
- package/apps/core/src/app/core/permissionApp/_types.d.ts +2 -1
- package/apps/core/src/domain/permission/_types.d.ts +4 -1
- package/apps/core/src/domain/permission/attributeDependentValuesPermissionDomain.d.ts +35 -0
- package/apps/core/src/domain/permission/helpers/permissionByUserGroups.d.ts +2 -1
- package/apps/core/src/domain/permission/index.d.ts +1 -0
- package/apps/core/src/domain/permission/permissionDomain.d.ts +4 -2
- package/apps/core/src/domain/value/helpers/canSaveRecordValue.d.ts +3 -1
- package/apps/core/src/domain/value/valueDomain.d.ts +3 -1
- package/apps/core/src/infra/permission/permissionRepo.d.ts +3 -2
- package/package.json +1 -1
- /package/apps/core/src/__tests__/e2e/api/{trees/treeNodeChildren.test.d.ts → permissions/dependentValuesTreeAttributePermissions.test.d.ts} +0 -0
|
@@ -128,6 +128,7 @@ export declare namespace permissions {
|
|
|
128
128
|
let enableCache_1: boolean;
|
|
129
129
|
export { enableCache_1 as enableCache };
|
|
130
130
|
export let enableAccessRecordByDefaultBackendFilter: boolean;
|
|
131
|
+
export let enableAttributeDependentValuesPermissions: boolean;
|
|
131
132
|
}
|
|
132
133
|
export declare namespace amqp {
|
|
133
134
|
namespace connOpt {
|
|
@@ -5,6 +5,7 @@ import FormData from 'form-data';
|
|
|
5
5
|
import { type ActionsListConfig } from '_types/actionsList';
|
|
6
6
|
import { type ITreeElement } from '_types/tree';
|
|
7
7
|
import { AttributeFormats, type AttributeTypes, type IAttributeVersionsConf, type IEmbeddedAttribute } from '../../../_types/attribute';
|
|
8
|
+
import { type ITreePermissionsDependentValuesConf } from '_types/permissions';
|
|
8
9
|
export interface IGlobalThis {
|
|
9
10
|
guestUser: IE2EUserParams;
|
|
10
11
|
nonAdminUser: IE2EUserParams;
|
|
@@ -51,6 +52,7 @@ export declare function gqlSaveAttribute(params: {
|
|
|
51
52
|
unique?: boolean;
|
|
52
53
|
actionsList?: ActionsListConfig;
|
|
53
54
|
required?: boolean;
|
|
55
|
+
permissions_conf_dependent_values?: ITreePermissionsDependentValuesConf;
|
|
54
56
|
}): Promise<any>;
|
|
55
57
|
export declare function gqlSaveTree(id: string, label: string, libraries: string[]): Promise<any>;
|
|
56
58
|
export declare function gqlCreateRecord(library: string): Promise<string>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type ITask, TaskStatus } from '../../../_types/tasksManager';
|
|
2
|
+
export declare function getTask(taskId: string): Promise<ITask>;
|
|
3
|
+
export declare function waitForTaskCompletion(id: string, timeout?: number, interval?: number): Promise<ITask>;
|
|
4
|
+
export declare function waitForTaskCompletedWithStatus(taskId: string, expectedStatus: TaskStatus.DONE | TaskStatus.FAILED): Promise<ITask>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { type ILibraryRepo } from 'infra/library/libraryRepo';
|
|
2
|
+
import { type IPermissionRepo } from 'infra/permission/permissionRepo';
|
|
2
3
|
import { type IRecordRepo } from 'infra/record/recordRepo';
|
|
3
4
|
import { type ITreeRepo } from 'infra/tree/treeRepo';
|
|
4
5
|
export declare const getLibraryRepo: () => ILibraryRepo;
|
|
5
6
|
export declare const getRecordRepo: () => IRecordRepo;
|
|
6
7
|
export declare const getTreeRepo: () => ITreeRepo;
|
|
8
|
+
export declare const getPermissionRepo: () => IPermissionRepo;
|
|
7
9
|
export * from '../integrationTestUtils';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -33,6 +33,7 @@ export declare const mockAttrTree: {
|
|
|
33
33
|
settings?: import("../../_types/shared").IKeyValue<any>;
|
|
34
34
|
multi_link_display_option?: MultiDisplayOption;
|
|
35
35
|
multi_tree_display_option?: MultiDisplayOption;
|
|
36
|
+
permissions_conf_dependent_values?: import("../../_types/permissions").ITreePermissionsDependentValuesConf;
|
|
36
37
|
label?: import("../../_types/systemTranslation").ISystemTranslation | string;
|
|
37
38
|
};
|
|
38
39
|
export declare const mockAttrTreeVersionable: IAttribute;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ActionsListEvents, type ActionsListIOTypes, type ActionsListConfig } from './actionsList';
|
|
2
|
-
import { type ITreePermissionsConf } from './permissions';
|
|
2
|
+
import { type ITreePermissionsDependentValuesConf, type ITreePermissionsConf } from './permissions';
|
|
3
3
|
import { type IQueryInfos } from './queryInfos';
|
|
4
4
|
import { type IRecord } from './record';
|
|
5
5
|
import { type IGetCoreEntitiesParams, type IKeyValue } from './shared';
|
|
@@ -28,6 +28,10 @@ export interface IAttribute extends ICoreEntity {
|
|
|
28
28
|
settings?: IKeyValue<any>;
|
|
29
29
|
multi_link_display_option?: MultiDisplayOption;
|
|
30
30
|
multi_tree_display_option?: MultiDisplayOption;
|
|
31
|
+
/**
|
|
32
|
+
* only for tree attribute
|
|
33
|
+
*/
|
|
34
|
+
permissions_conf_dependent_values?: ITreePermissionsDependentValuesConf;
|
|
31
35
|
}
|
|
32
36
|
export declare enum ValueVersionMode {
|
|
33
37
|
SIMPLE = "simple",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Options } from 'amqplib';
|
|
2
2
|
import { type IKeyValue } from './shared';
|
|
3
|
-
import { type PermissionsActions, type AdminPermissionsActions, type ApplicationPermissionsActions, type AttributePermissionsActions, type LibraryPermissionsActions, type PermissionTypes, type RecordAttributePermissionsActions, type RecordPermissionsActions, type TreeNodePermissionsActions, type TreePermissionsActions } from './permissions';
|
|
3
|
+
import { type PermissionsActions, type AdminPermissionsActions, type ApplicationPermissionsActions, type AttributePermissionsActions, type LibraryPermissionsActions, type PermissionTypes, type RecordAttributePermissionsActions, type RecordPermissionsActions, type TreeNodePermissionsActions, type TreePermissionsActions, type AttributeDependentValuesPermissionsActions } from './permissions';
|
|
4
4
|
export interface IConfig {
|
|
5
5
|
coreMode: CoreMode;
|
|
6
6
|
server: IServer;
|
|
@@ -158,6 +158,7 @@ interface IPermissionsByTypesAndActions {
|
|
|
158
158
|
[PermissionTypes.ADMIN]?: IPermissionsByActions<AdminPermissionsActions>;
|
|
159
159
|
[PermissionTypes.APPLICATION]?: IPermissionsByActions<ApplicationPermissionsActions>;
|
|
160
160
|
[PermissionTypes.ATTRIBUTE]?: IPermissionsByActions<AttributePermissionsActions>;
|
|
161
|
+
[PermissionTypes.ATTRIBUTE_DEPENDENT_VALUES]?: IPermissionsByActions<AttributeDependentValuesPermissionsActions>;
|
|
161
162
|
[PermissionTypes.LIBRARY]?: IPermissionsByActions<LibraryPermissionsActions>;
|
|
162
163
|
[PermissionTypes.RECORD]?: IPermissionsByActions<RecordPermissionsActions>;
|
|
163
164
|
[PermissionTypes.RECORD_ATTRIBUTE]?: IPermissionsByActions<RecordAttributePermissionsActions>;
|
|
@@ -170,6 +171,7 @@ export interface IPermissions {
|
|
|
170
171
|
adminGroup: IPermissionsByTypesAndActions;
|
|
171
172
|
enableCache: boolean;
|
|
172
173
|
enableAccessRecordByDefaultBackendFilter: boolean;
|
|
174
|
+
enableAttributeDependentValuesPermissions: boolean;
|
|
173
175
|
}
|
|
174
176
|
export interface IAmqp {
|
|
175
177
|
connOpt: Options.Connect;
|
|
@@ -8,6 +8,7 @@ export declare enum Errors {
|
|
|
8
8
|
ATTRIBUTE_USED_BY_LIBRARY = "ATTRIBUTE_USED_BY_LIBRARY",
|
|
9
9
|
ATTRIBUTE_USED_IN_METADATA = "ATTRIBUTE_USED_IN_METADATA",
|
|
10
10
|
CANNOT_SAVE_METADATA = "CANNOT_SAVE_METADATA",
|
|
11
|
+
CANNOT_SAVE_PERMISSIONS_DEPENDENT_VALUES = "CANNOT_SAVE_PERMISSIONS_DEPENDENT_VALUES",
|
|
11
12
|
DUPLICATE_DIRECTORY_NAMES = "DUPLICATE_DIRECTORY_NAMES",
|
|
12
13
|
DUPLICATE_FILENAMES = "DUPLICATE_FILENAMES",
|
|
13
14
|
ELEMENT_ALREADY_PRESENT = "ELEMENT_ALREADY_PRESENT",
|
|
@@ -5,6 +5,7 @@ export declare enum PermissionTypes {
|
|
|
5
5
|
ADMIN = "admin",
|
|
6
6
|
LIBRARY = "library",
|
|
7
7
|
ATTRIBUTE = "attribute",
|
|
8
|
+
ATTRIBUTE_DEPENDENT_VALUES = "attribute_dependent_values",
|
|
8
9
|
TREE = "tree",
|
|
9
10
|
TREE_NODE = "tree_node",
|
|
10
11
|
TREE_LIBRARY = "tree_library",
|
|
@@ -33,14 +34,18 @@ export declare enum AttributePermissionsActions {
|
|
|
33
34
|
ACCESS_ATTRIBUTE = "access_attribute",
|
|
34
35
|
EDIT_VALUE = "edit_value"
|
|
35
36
|
}
|
|
37
|
+
export declare enum AttributeDependentValuesPermissionsActions {
|
|
38
|
+
SET_VALUE = "set_value"
|
|
39
|
+
}
|
|
36
40
|
export declare enum TreePermissionsActions {
|
|
37
41
|
ACCESS_TREE = "access_tree",
|
|
38
|
-
EDIT_CHILDREN = "edit_children"
|
|
42
|
+
EDIT_CHILDREN = "edit_children",
|
|
43
|
+
DETACH = "detach"
|
|
39
44
|
}
|
|
40
45
|
export declare enum TreeNodePermissionsActions {
|
|
41
46
|
ACCESS_TREE = "access_tree",
|
|
42
|
-
|
|
43
|
-
|
|
47
|
+
EDIT_CHILDREN = "edit_children",
|
|
48
|
+
DETACH = "detach"
|
|
44
49
|
}
|
|
45
50
|
export declare enum ApplicationPermissionsActions {
|
|
46
51
|
ADMIN_APPLICATION = "admin_application",
|
|
@@ -81,7 +86,7 @@ export declare enum AdminPermissionsActions {
|
|
|
81
86
|
ACCESS_LOGS = "admin_access_logs",
|
|
82
87
|
IMPORT_CONFIG_CLEAR_DATABASE = "admin_import_config_clear_database"
|
|
83
88
|
}
|
|
84
|
-
export type PermissionsActions = LibraryPermissionsActions | RecordPermissionsActions | RecordAttributePermissionsActions | AdminPermissionsActions | AttributePermissionsActions | TreePermissionsActions | TreeNodePermissionsActions | ApplicationPermissionsActions;
|
|
89
|
+
export type PermissionsActions = LibraryPermissionsActions | RecordPermissionsActions | RecordAttributePermissionsActions | AdminPermissionsActions | AttributePermissionsActions | AttributeDependentValuesPermissionsActions | TreePermissionsActions | TreeNodePermissionsActions | ApplicationPermissionsActions;
|
|
85
90
|
export interface ILabeledPermissionsAction {
|
|
86
91
|
label: ISystemTranslation;
|
|
87
92
|
name: PermissionsActions | string;
|
|
@@ -103,6 +108,12 @@ export interface ITreePermissionsConf {
|
|
|
103
108
|
*/
|
|
104
109
|
relation: PermissionsRelations;
|
|
105
110
|
}
|
|
111
|
+
export interface ITreePermissionsDependentValuesConf {
|
|
112
|
+
/**
|
|
113
|
+
* IDs of attributes used for permissions
|
|
114
|
+
*/
|
|
115
|
+
dependenciesTreeAttributes: string[];
|
|
116
|
+
}
|
|
106
117
|
export interface IPermissionsTreeTarget {
|
|
107
118
|
/**
|
|
108
119
|
* Tree ID
|
|
@@ -113,6 +124,9 @@ export interface IPermissionsTreeTarget {
|
|
|
113
124
|
*/
|
|
114
125
|
nodeId: string | null;
|
|
115
126
|
}
|
|
127
|
+
export interface IPermissionsDependenciesTreeTarget extends IPermissionsTreeTarget {
|
|
128
|
+
attributeId: string;
|
|
129
|
+
}
|
|
116
130
|
export interface IPermission {
|
|
117
131
|
/**
|
|
118
132
|
* Permission type
|
|
@@ -135,6 +149,12 @@ export interface IPermission {
|
|
|
135
149
|
};
|
|
136
150
|
/**
|
|
137
151
|
* What element on permissions tree is concerned by this permission
|
|
152
|
+
* In case of type PermissionTypes.ATTRIBUTE_DEPENDENT_VALUES, this is the value tree target
|
|
138
153
|
*/
|
|
139
154
|
permissionTreeTarget?: IPermissionsTreeTarget;
|
|
155
|
+
/**
|
|
156
|
+
* For dependent values tree attribute permissions, the list of attributes on which this permission depends
|
|
157
|
+
* Only for PermissionTypes.ATTRIBUTE_DEPENDENT_VALUES
|
|
158
|
+
*/
|
|
159
|
+
dependenciesTreeTargets?: IPermissionsDependenciesTreeTarget[];
|
|
140
160
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { type IPermissionsTreeTarget, type PermissionsActions, type PermissionTypes } from '_types/permissions';
|
|
1
|
+
import { type IPermissionsDependenciesTreeTarget, type IPermissionsTreeTarget, type PermissionsActions, type PermissionTypes } from '_types/permissions';
|
|
2
2
|
export interface IInheritedPermissionsQueryParams {
|
|
3
3
|
type: PermissionTypes;
|
|
4
4
|
applyTo: string;
|
|
5
5
|
actions: PermissionsActions[];
|
|
6
6
|
userGroupNodeId: string;
|
|
7
7
|
permissionTreeTarget: IPermissionsTreeTarget;
|
|
8
|
+
dependenciesTreeTargets: IPermissionsDependenciesTreeTarget[];
|
|
8
9
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type AdminPermissionsActions, type ApplicationPermissionsActions, type AttributePermissionsActions, type IPermissionsTreeTarget, type ITreePermissionsConf, type LibraryPermissionsActions, type PermissionsActions, type PermissionTypes, type RecordAttributePermissionsActions, type RecordPermissionsActions, type TreeNodePermissionsActions, type TreePermissionsActions } from '_types/permissions';
|
|
1
|
+
import { type IPermissionsDependenciesTreeTarget, type AdminPermissionsActions, type ApplicationPermissionsActions, type AttributePermissionsActions, type IPermissionsTreeTarget, type ITreePermissionsConf, type LibraryPermissionsActions, type PermissionsActions, type PermissionTypes, type RecordAttributePermissionsActions, type RecordPermissionsActions, type TreeNodePermissionsActions, type TreePermissionsActions } from '_types/permissions';
|
|
2
2
|
import { type IQueryInfos } from '_types/queryInfos';
|
|
3
3
|
import { type IGetDefaultPermissionParams } from './helpers/defaultPermission';
|
|
4
4
|
export declare const PERMISSIONS_CACHE_HEADER = "permissions";
|
|
@@ -15,6 +15,7 @@ export interface IGetSimplePermissionsParams {
|
|
|
15
15
|
action: PermissionsActions;
|
|
16
16
|
usersGroupNodeId: string;
|
|
17
17
|
permissionTreeTarget?: IPermissionsTreeTarget;
|
|
18
|
+
dependenciesTreeTargets?: IPermissionsDependenciesTreeTarget[];
|
|
18
19
|
ctx: IQueryInfos;
|
|
19
20
|
}
|
|
20
21
|
export interface IGetPermissionsByActionsParams {
|
|
@@ -23,6 +24,7 @@ export interface IGetPermissionsByActionsParams {
|
|
|
23
24
|
actions: PermissionsActions[];
|
|
24
25
|
usersGroupNodeId: string;
|
|
25
26
|
permissionTreeTarget?: IPermissionsTreeTarget;
|
|
27
|
+
dependenciesTreeTargets?: IPermissionsDependenciesTreeTarget[];
|
|
26
28
|
ctx: IQueryInfos;
|
|
27
29
|
}
|
|
28
30
|
export type PermByActionsRes = {
|
|
@@ -121,6 +123,7 @@ export interface IGetInheritedPermissionsParams {
|
|
|
121
123
|
action: PermissionsActions;
|
|
122
124
|
userGroupId: string;
|
|
123
125
|
permissionTreeTarget?: IPermissionsTreeTarget;
|
|
126
|
+
dependenciesTreeTargets?: IPermissionsDependenciesTreeTarget[];
|
|
124
127
|
ctx: IQueryInfos;
|
|
125
128
|
}
|
|
126
129
|
export interface IIsAllowedParams {
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type IQueryInfos } from '_types/queryInfos';
|
|
2
|
+
import { type IValueRepo } from 'infra/value/valueRepo';
|
|
3
|
+
import { type AttributeDependentValuesPermissionsActions, type IPermissionsDependenciesTreeTarget, type IPermissionsTreeTarget } from '../../_types/permissions';
|
|
4
|
+
import { type IAttributeDomain } from '../attribute/attributeDomain';
|
|
5
|
+
import { type IPermissionByUserGroupsHelper } from './helpers/permissionByUserGroups';
|
|
6
|
+
import { type IElementAncestorsHelper } from 'domain/tree/helpers/elementAncestors';
|
|
7
|
+
import { type IDefaultPermissionHelper } from './helpers/defaultPermission';
|
|
8
|
+
import { type IConfig } from '_types/config';
|
|
9
|
+
export interface IAttributeDependentValuesPermissionDomain {
|
|
10
|
+
getAttributeDependentValuesPermission(params: {
|
|
11
|
+
action: AttributeDependentValuesPermissionsActions;
|
|
12
|
+
attributeId: string;
|
|
13
|
+
recordLibrary: string;
|
|
14
|
+
recordId: string;
|
|
15
|
+
valueNodeId: string;
|
|
16
|
+
ctx: IQueryInfos;
|
|
17
|
+
}): Promise<boolean>;
|
|
18
|
+
getInheritedAttributeDependentValuesPermission(params: {
|
|
19
|
+
action: AttributeDependentValuesPermissionsActions;
|
|
20
|
+
attributeId: string;
|
|
21
|
+
userGroupId: string;
|
|
22
|
+
permissionTreeTarget: IPermissionsTreeTarget;
|
|
23
|
+
dependenciesTreeTargets: IPermissionsDependenciesTreeTarget[];
|
|
24
|
+
ctx: IQueryInfos;
|
|
25
|
+
}): Promise<boolean>;
|
|
26
|
+
}
|
|
27
|
+
export interface IRecordAttributePermissionDomainDeps {
|
|
28
|
+
'core.domain.permission.helpers.permissionByUserGroups': IPermissionByUserGroupsHelper;
|
|
29
|
+
'core.domain.permission.helpers.defaultPermission': IDefaultPermissionHelper;
|
|
30
|
+
'core.domain.attribute': IAttributeDomain;
|
|
31
|
+
'core.domain.tree.helpers.elementAncestors': IElementAncestorsHelper;
|
|
32
|
+
'core.infra.value': IValueRepo;
|
|
33
|
+
config: IConfig;
|
|
34
|
+
}
|
|
35
|
+
export default function (deps: IRecordAttributePermissionDomainDeps): IAttributeDependentValuesPermissionDomain;
|
|
@@ -2,7 +2,7 @@ import { type IReducePermissionsArrayHelper } from './reducePermissionsArray';
|
|
|
2
2
|
import { type ISimplePermissionHelper } from './simplePermission';
|
|
3
3
|
import { type IDefaultPermissionHelper } from './defaultPermission';
|
|
4
4
|
import { type TreePath } from '../../../_types/tree';
|
|
5
|
-
import { type
|
|
5
|
+
import { PermissionTypes, type IPermissionsDependenciesTreeTarget, type PermissionsActions } from '../../../_types/permissions';
|
|
6
6
|
import { type IQueryInfos } from '../../../_types/queryInfos';
|
|
7
7
|
import { type ICachesService } from '../../../infra/cache/cacheService';
|
|
8
8
|
import { type IConfig } from '_types/config';
|
|
@@ -23,6 +23,7 @@ interface IGetPermissionByUserGroupsParams {
|
|
|
23
23
|
tree: string;
|
|
24
24
|
path: TreePath;
|
|
25
25
|
};
|
|
26
|
+
dependenciesTreeTargets?: IPermissionsDependenciesTreeTarget[];
|
|
26
27
|
getDefaultGlobalPermission?: GetDefaultGlobalPermission;
|
|
27
28
|
ctx: IQueryInfos;
|
|
28
29
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { default as admin } from './adminPermissionDomain';
|
|
2
2
|
export { default as application } from './applicationPermissionDomain';
|
|
3
3
|
export { default as attribute } from './attributePermissionDomain';
|
|
4
|
+
export { default as attributeDependentValues } from './attributeDependentValuesPermissionDomain';
|
|
4
5
|
export { default as library } from './libraryPermissionDomain';
|
|
5
6
|
export { default } from './permissionDomain';
|
|
6
7
|
export { default as recordAttribute } from './recordAttributePermissionDomain';
|
|
@@ -8,6 +8,7 @@ import { type ILabeledPermissionsAction, type IPermission, PermissionTypes } fro
|
|
|
8
8
|
import { type IAdminPermissionDomain } from './adminPermissionDomain';
|
|
9
9
|
import { type IApplicationPermissionDomain } from './applicationPermissionDomain';
|
|
10
10
|
import { type IAttributePermissionDomain } from './attributePermissionDomain';
|
|
11
|
+
import { type IAttributeDependentValuesPermissionDomain } from './attributeDependentValuesPermissionDomain';
|
|
11
12
|
import { type ILibraryPermissionDomain } from './libraryPermissionDomain';
|
|
12
13
|
import { type IRecordAttributePermissionDomain } from './recordAttributePermissionDomain';
|
|
13
14
|
import { type IRecordPermissionDomain } from './recordPermissionDomain';
|
|
@@ -18,11 +19,11 @@ import { type IGetActionsByTypeParams, type IGetInheritedPermissionsParams, type
|
|
|
18
19
|
import { type IDefaultPermissionHelper } from './helpers/defaultPermission';
|
|
19
20
|
export interface IPermissionDomain {
|
|
20
21
|
savePermission(permData: IPermission, ctx: IQueryInfos): Promise<IPermission>;
|
|
21
|
-
getPermissionsByActions({ type, applyTo, actions, usersGroupNodeId, permissionTreeTarget, ctx, }: IGetPermissionsByActionsParams): Promise<PermByActionsRes>;
|
|
22
|
+
getPermissionsByActions({ type, applyTo, actions, usersGroupNodeId, permissionTreeTarget, dependenciesTreeTargets, ctx, }: IGetPermissionsByActionsParams): Promise<PermByActionsRes>;
|
|
22
23
|
/**
|
|
23
24
|
* Retrieve herited permission: ignore permission defined on given element, force retrieval of herited permission
|
|
24
25
|
*/
|
|
25
|
-
getInheritedPermissions({ type, applyTo, action, userGroupId, permissionTreeTarget, ctx, }: IGetInheritedPermissionsParams): Promise<boolean>;
|
|
26
|
+
getInheritedPermissions({ type, applyTo, action, userGroupId, permissionTreeTarget, dependenciesTreeTargets, ctx, }: IGetInheritedPermissionsParams): Promise<boolean>;
|
|
26
27
|
isAllowed({ type, action, applyTo, target, ctx }: IIsAllowedParams): Promise<boolean>;
|
|
27
28
|
getActionsByType(params: IGetActionsByTypeParams): Promise<ILabeledPermissionsAction[]>;
|
|
28
29
|
registerActions(type: PermissionTypes, actions: string[], applyOn?: string[]): void;
|
|
@@ -33,6 +34,7 @@ export interface IPermissionDomainDeps {
|
|
|
33
34
|
'core.domain.permission.library': ILibraryPermissionDomain;
|
|
34
35
|
'core.domain.permission.record': IRecordPermissionDomain;
|
|
35
36
|
'core.domain.permission.attribute': IAttributePermissionDomain;
|
|
37
|
+
'core.domain.permission.attributeDependentValues': IAttributeDependentValuesPermissionDomain;
|
|
36
38
|
'core.domain.permission.recordAttribute': IRecordAttributePermissionDomain;
|
|
37
39
|
'core.domain.permission.tree': ITreePermissionDomain;
|
|
38
40
|
'core.domain.permission.treeNode': ITreeNodePermissionDomain;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { type IAttributeDependentValuesPermissionDomain } from 'domain/permission/attributeDependentValuesPermissionDomain';
|
|
1
2
|
import { type IRecordAttributePermissionDomain } from 'domain/permission/recordAttributePermissionDomain';
|
|
2
3
|
import { type IRecordPermissionDomain } from 'domain/permission/recordPermissionDomain';
|
|
3
|
-
import { type IAttribute } from '_types/attribute';
|
|
4
|
+
import { type IAttribute } from '../../../_types/attribute';
|
|
4
5
|
import { type IConfig } from '_types/config';
|
|
5
6
|
import { type IQueryInfos } from '_types/queryInfos';
|
|
6
7
|
import { type IValue } from '_types/value';
|
|
@@ -21,6 +22,7 @@ interface ICanSaveRecordValueParams {
|
|
|
21
22
|
deps: {
|
|
22
23
|
recordPermissionDomain: IRecordPermissionDomain;
|
|
23
24
|
recordAttributePermissionDomain: IRecordAttributePermissionDomain;
|
|
25
|
+
attributeDependentValuesPermissionDomain: IAttributeDependentValuesPermissionDomain;
|
|
24
26
|
config: IConfig;
|
|
25
27
|
};
|
|
26
28
|
}
|
|
@@ -18,6 +18,7 @@ import { type IValueVersion, type ISaveValue, type IValue, type IValuesOptions,
|
|
|
18
18
|
import { type IActionsListDomain } from '../actionsList/actionsListDomain';
|
|
19
19
|
import { type IAttributeDomain } from '../attribute/attributeDomain';
|
|
20
20
|
import { type IValidateHelper } from '../helpers/validate';
|
|
21
|
+
import { type IAttributeDependentValuesPermissionDomain } from 'domain/permission/attributeDependentValuesPermissionDomain';
|
|
21
22
|
import { type IRecordAttributePermissionDomain } from '../permission/recordAttributePermissionDomain';
|
|
22
23
|
import { type IRecordPermissionDomain } from '../permission/recordPermissionDomain';
|
|
23
24
|
import { type IDeleteValueParams } from './_types';
|
|
@@ -121,6 +122,7 @@ export interface IValueDomainDeps {
|
|
|
121
122
|
config: Config.IConfig;
|
|
122
123
|
'core.domain.actionsList': IActionsListDomain;
|
|
123
124
|
'core.domain.attribute': IAttributeDomain;
|
|
125
|
+
'core.domain.permission.attributeDependentValues': IAttributeDependentValuesPermissionDomain;
|
|
124
126
|
'core.domain.permission.recordAttribute': IRecordAttributePermissionDomain;
|
|
125
127
|
'core.domain.permission.record': IRecordPermissionDomain;
|
|
126
128
|
'core.domain.eventsManager': IEventsManagerDomain;
|
|
@@ -142,5 +144,5 @@ export interface IValueDomainDeps {
|
|
|
142
144
|
'core.utils.logger': ILogger;
|
|
143
145
|
'core.domain.tree': ITreeDomain;
|
|
144
146
|
}
|
|
145
|
-
declare const valueDomain: ({ config, "core.domain.actionsList": actionsListDomain, "core.domain.attribute": attributeDomain, "core.domain.permission.recordAttribute": recordAttributePermissionDomain, "core.domain.permission.record": recordPermissionDomain, "core.domain.eventsManager": eventsManager, "core.domain.helpers.validate": validate, "core.domain.helpers.updateRecordLastModif": updateRecordLastModif, "core.domain.tree.helpers.elementAncestors": elementAncestors, "core.domain.tree.helpers.getDefaultElement": getDefaultElementHelper, "core.domain.record.helpers.sendRecordUpdateEvent": sendRecordUpdateEvent, "core.domain.record.helpers.createRecord": createRecordHelper, "core.domain.record.helpers.findRecords": findRecordsHelper, "core.domain.permission.helpers.recordInCreationBypass": recordInCreationBypassHelper, "core.domain.record.helpers.deleteRecord": deleteRecordHelper, "core.domain.attribute.helpers.ifLibraryJoinLinkAttribute": ifLibraryJoinLinkAttribute, "core.domain.versionProfile": versionProfileDomain, "core.infra.record": recordRepo, "core.infra.tree": treeRepo, "core.infra.value": valueRepo, "core.utils": utils, "core.utils.logger": logger, }: IValueDomainDeps) => IValueDomain;
|
|
147
|
+
declare const valueDomain: ({ config, "core.domain.actionsList": actionsListDomain, "core.domain.attribute": attributeDomain, "core.domain.permission.attributeDependentValues": attributeDependentValuesPermissionDomain, "core.domain.permission.recordAttribute": recordAttributePermissionDomain, "core.domain.permission.record": recordPermissionDomain, "core.domain.eventsManager": eventsManager, "core.domain.helpers.validate": validate, "core.domain.helpers.updateRecordLastModif": updateRecordLastModif, "core.domain.tree.helpers.elementAncestors": elementAncestors, "core.domain.tree.helpers.getDefaultElement": getDefaultElementHelper, "core.domain.record.helpers.sendRecordUpdateEvent": sendRecordUpdateEvent, "core.domain.record.helpers.createRecord": createRecordHelper, "core.domain.record.helpers.findRecords": findRecordsHelper, "core.domain.permission.helpers.recordInCreationBypass": recordInCreationBypassHelper, "core.domain.record.helpers.deleteRecord": deleteRecordHelper, "core.domain.attribute.helpers.ifLibraryJoinLinkAttribute": ifLibraryJoinLinkAttribute, "core.domain.versionProfile": versionProfileDomain, "core.infra.record": recordRepo, "core.infra.tree": treeRepo, "core.infra.value": valueRepo, "core.utils": utils, "core.utils.logger": logger, }: IValueDomainDeps) => IValueDomain;
|
|
146
148
|
export default valueDomain;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type IQueryInfos } from '_types/queryInfos';
|
|
2
|
-
import { type IPermission, type IPermissionsTreeTarget, type PermissionsActions, type PermissionTypes } from '../../_types/permissions';
|
|
2
|
+
import { type IPermissionsDependenciesTreeTarget, type IPermission, type IPermissionsTreeTarget, type PermissionsActions, type PermissionTypes } from '../../_types/permissions';
|
|
3
3
|
import { type IDbService } from '../db/dbService';
|
|
4
4
|
import { type IDbUtils } from '../db/dbUtils';
|
|
5
5
|
export interface IPermissionRepo {
|
|
@@ -7,11 +7,12 @@ export interface IPermissionRepo {
|
|
|
7
7
|
permData: IPermission;
|
|
8
8
|
ctx: IQueryInfos;
|
|
9
9
|
}): Promise<IPermission>;
|
|
10
|
-
getPermissions({ type, applyTo, usersGroupNodeId, permissionTreeTarget, ctx, }: {
|
|
10
|
+
getPermissions({ type, applyTo, usersGroupNodeId, permissionTreeTarget, dependenciesTreeTargets, ctx, }: {
|
|
11
11
|
type: PermissionTypes;
|
|
12
12
|
applyTo: string;
|
|
13
13
|
usersGroupNodeId: string | null;
|
|
14
14
|
permissionTreeTarget?: IPermissionsTreeTarget;
|
|
15
|
+
dependenciesTreeTargets?: IPermissionsDependenciesTreeTarget[];
|
|
15
16
|
ctx: IQueryInfos;
|
|
16
17
|
}): Promise<IPermission | null>;
|
|
17
18
|
getAllPermissionsForTree({ type, applyTo, actionKey, treeId, groupsIds, ctx, }: {
|
package/package.json
CHANGED