@esri/hub-common 13.37.3 → 13.38.0
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/dist/esm/ArcGISContext.js +31 -0
- package/dist/esm/ArcGISContext.js.map +1 -1
- package/dist/esm/ArcGISContextManager.js +44 -0
- package/dist/esm/ArcGISContextManager.js.map +1 -1
- package/dist/esm/capabilities/_internal/checkCapabilityAccess.js +2 -0
- package/dist/esm/capabilities/_internal/checkCapabilityAccess.js.map +1 -1
- package/dist/esm/capabilities/checkCapability.js +2 -0
- package/dist/esm/capabilities/checkCapability.js.map +1 -1
- package/dist/esm/capabilities/getWorkspaceCapabilities.js +3 -1
- package/dist/esm/capabilities/getWorkspaceCapabilities.js.map +1 -1
- package/dist/esm/capabilities/processEntityCapabilities.js +2 -0
- package/dist/esm/capabilities/processEntityCapabilities.js.map +1 -1
- package/dist/esm/content/_internal/ContentBusinessRules.js +6 -6
- package/dist/esm/content/_internal/ContentBusinessRules.js.map +1 -1
- package/dist/esm/content/_internal/getPropertyMap.js +1 -0
- package/dist/esm/content/_internal/getPropertyMap.js.map +1 -1
- package/dist/esm/core/HubItemEntity.js +3 -0
- package/dist/esm/core/HubItemEntity.js.map +1 -1
- package/dist/esm/core/_internal/getBasePropertyMap.js +1 -0
- package/dist/esm/core/_internal/getBasePropertyMap.js.map +1 -1
- package/dist/esm/core/types/ISystemStatus.js +20 -0
- package/dist/esm/core/types/ISystemStatus.js.map +1 -1
- package/dist/esm/core/types/index.js +1 -0
- package/dist/esm/core/types/index.js.map +1 -1
- package/dist/esm/discussions/_internal/DiscussionBusinessRules.js +11 -4
- package/dist/esm/discussions/_internal/DiscussionBusinessRules.js.map +1 -1
- package/dist/esm/groups/_internal/GroupBusinessRules.js +12 -6
- package/dist/esm/groups/_internal/GroupBusinessRules.js.map +1 -1
- package/dist/esm/initiatives/_internal/InitiativeBusinessRules.js +36 -8
- package/dist/esm/initiatives/_internal/InitiativeBusinessRules.js.map +1 -1
- package/dist/esm/initiatives/_internal/computeProps.js +8 -2
- package/dist/esm/initiatives/_internal/computeProps.js.map +1 -1
- package/dist/esm/initiatives/defaults.js +2 -0
- package/dist/esm/initiatives/defaults.js.map +1 -1
- package/dist/esm/pages/_internal/PageBusinessRules.js +17 -11
- package/dist/esm/pages/_internal/PageBusinessRules.js.map +1 -1
- package/dist/esm/pages/_internal/computeProps.js +9 -2
- package/dist/esm/pages/_internal/computeProps.js.map +1 -1
- package/dist/esm/permissions/_internal/checkAlphaGating.js +3 -1
- package/dist/esm/permissions/_internal/checkAlphaGating.js.map +1 -1
- package/dist/esm/permissions/_internal/checkAvailability.js +46 -0
- package/dist/esm/permissions/_internal/checkAvailability.js.map +1 -0
- package/dist/esm/permissions/_internal/checkEntityFeature.js +26 -0
- package/dist/esm/permissions/_internal/checkEntityFeature.js.map +1 -0
- package/dist/esm/permissions/_internal/checkEnvironment.js +28 -0
- package/dist/esm/permissions/_internal/checkEnvironment.js.map +1 -0
- package/dist/esm/permissions/_internal/checkParents.js +23 -0
- package/dist/esm/permissions/_internal/checkParents.js.map +1 -0
- package/dist/esm/permissions/_internal/checkServiceStatus.js +24 -0
- package/dist/esm/permissions/_internal/checkServiceStatus.js.map +1 -0
- package/dist/esm/permissions/_internal/getPolicyResponseCode.js +8 -0
- package/dist/esm/permissions/_internal/getPolicyResponseCode.js.map +1 -1
- package/dist/esm/permissions/_internal/processEntityFeatures.js +26 -0
- package/dist/esm/permissions/_internal/processEntityFeatures.js.map +1 -0
- package/dist/esm/permissions/checkPermission.js +10 -0
- package/dist/esm/permissions/checkPermission.js.map +1 -1
- package/dist/esm/projects/_internal/ProjectBusinessRules.js +37 -11
- package/dist/esm/projects/_internal/ProjectBusinessRules.js.map +1 -1
- package/dist/esm/projects/_internal/computeProps.js +8 -2
- package/dist/esm/projects/_internal/computeProps.js.map +1 -1
- package/dist/esm/projects/defaults.js +2 -0
- package/dist/esm/projects/defaults.js.map +1 -1
- package/dist/esm/sites/_internal/SiteBusinessRules.js +37 -8
- package/dist/esm/sites/_internal/SiteBusinessRules.js.map +1 -1
- package/dist/esm/sites/_internal/computeProps.js +8 -2
- package/dist/esm/sites/_internal/computeProps.js.map +1 -1
- package/dist/esm/sites/defaults.js +2 -0
- package/dist/esm/sites/defaults.js.map +1 -1
- package/dist/esm/utils/getEnvironmentFromPortalUrl.js +20 -0
- package/dist/esm/utils/getEnvironmentFromPortalUrl.js.map +1 -0
- package/dist/esm/utils/index.js +1 -0
- package/dist/esm/utils/index.js.map +1 -1
- package/dist/node/ArcGISContext.js +31 -0
- package/dist/node/ArcGISContext.js.map +1 -1
- package/dist/node/ArcGISContextManager.js +44 -0
- package/dist/node/ArcGISContextManager.js.map +1 -1
- package/dist/node/capabilities/_internal/checkCapabilityAccess.js +2 -0
- package/dist/node/capabilities/_internal/checkCapabilityAccess.js.map +1 -1
- package/dist/node/capabilities/checkCapability.js +2 -0
- package/dist/node/capabilities/checkCapability.js.map +1 -1
- package/dist/node/capabilities/getWorkspaceCapabilities.js +3 -1
- package/dist/node/capabilities/getWorkspaceCapabilities.js.map +1 -1
- package/dist/node/capabilities/processEntityCapabilities.js +2 -0
- package/dist/node/capabilities/processEntityCapabilities.js.map +1 -1
- package/dist/node/content/_internal/ContentBusinessRules.js +6 -6
- package/dist/node/content/_internal/ContentBusinessRules.js.map +1 -1
- package/dist/node/content/_internal/getPropertyMap.js +1 -0
- package/dist/node/content/_internal/getPropertyMap.js.map +1 -1
- package/dist/node/core/HubItemEntity.js +3 -0
- package/dist/node/core/HubItemEntity.js.map +1 -1
- package/dist/node/core/_internal/getBasePropertyMap.js +1 -0
- package/dist/node/core/_internal/getBasePropertyMap.js.map +1 -1
- package/dist/node/core/types/ISystemStatus.js +22 -1
- package/dist/node/core/types/ISystemStatus.js.map +1 -1
- package/dist/node/core/types/index.js +1 -0
- package/dist/node/core/types/index.js.map +1 -1
- package/dist/node/discussions/_internal/DiscussionBusinessRules.js +11 -4
- package/dist/node/discussions/_internal/DiscussionBusinessRules.js.map +1 -1
- package/dist/node/groups/_internal/GroupBusinessRules.js +12 -6
- package/dist/node/groups/_internal/GroupBusinessRules.js.map +1 -1
- package/dist/node/initiatives/_internal/InitiativeBusinessRules.js +37 -9
- package/dist/node/initiatives/_internal/InitiativeBusinessRules.js.map +1 -1
- package/dist/node/initiatives/_internal/computeProps.js +7 -1
- package/dist/node/initiatives/_internal/computeProps.js.map +1 -1
- package/dist/node/initiatives/defaults.js +2 -0
- package/dist/node/initiatives/defaults.js.map +1 -1
- package/dist/node/pages/_internal/PageBusinessRules.js +18 -12
- package/dist/node/pages/_internal/PageBusinessRules.js.map +1 -1
- package/dist/node/pages/_internal/computeProps.js +8 -1
- package/dist/node/pages/_internal/computeProps.js.map +1 -1
- package/dist/node/permissions/_internal/checkAlphaGating.js +3 -1
- package/dist/node/permissions/_internal/checkAlphaGating.js.map +1 -1
- package/dist/node/permissions/_internal/checkAvailability.js +50 -0
- package/dist/node/permissions/_internal/checkAvailability.js.map +1 -0
- package/dist/node/permissions/_internal/checkEntityFeature.js +30 -0
- package/dist/node/permissions/_internal/checkEntityFeature.js.map +1 -0
- package/dist/node/permissions/_internal/checkEnvironment.js +32 -0
- package/dist/node/permissions/_internal/checkEnvironment.js.map +1 -0
- package/dist/node/permissions/_internal/checkParents.js +27 -0
- package/dist/node/permissions/_internal/checkParents.js.map +1 -0
- package/dist/node/permissions/_internal/checkServiceStatus.js +28 -0
- package/dist/node/permissions/_internal/checkServiceStatus.js.map +1 -0
- package/dist/node/permissions/_internal/getPolicyResponseCode.js +8 -0
- package/dist/node/permissions/_internal/getPolicyResponseCode.js.map +1 -1
- package/dist/node/permissions/_internal/processEntityFeatures.js +30 -0
- package/dist/node/permissions/_internal/processEntityFeatures.js.map +1 -0
- package/dist/node/permissions/checkPermission.js +10 -0
- package/dist/node/permissions/checkPermission.js.map +1 -1
- package/dist/node/projects/_internal/ProjectBusinessRules.js +38 -12
- package/dist/node/projects/_internal/ProjectBusinessRules.js.map +1 -1
- package/dist/node/projects/_internal/computeProps.js +7 -1
- package/dist/node/projects/_internal/computeProps.js.map +1 -1
- package/dist/node/projects/defaults.js +2 -0
- package/dist/node/projects/defaults.js.map +1 -1
- package/dist/node/sites/_internal/SiteBusinessRules.js +38 -9
- package/dist/node/sites/_internal/SiteBusinessRules.js.map +1 -1
- package/dist/node/sites/_internal/computeProps.js +7 -1
- package/dist/node/sites/_internal/computeProps.js.map +1 -1
- package/dist/node/sites/defaults.js +2 -0
- package/dist/node/sites/defaults.js.map +1 -1
- package/dist/node/utils/getEnvironmentFromPortalUrl.js +24 -0
- package/dist/node/utils/getEnvironmentFromPortalUrl.js.map +1 -0
- package/dist/node/utils/index.js +1 -0
- package/dist/node/utils/index.js.map +1 -1
- package/dist/types/ArcGISContext.d.ts +37 -4
- package/dist/types/ArcGISContextManager.d.ts +8 -2
- package/dist/types/capabilities/getWorkspaceCapabilities.d.ts +1 -1
- package/dist/types/content/_internal/ContentBusinessRules.d.ts +3 -0
- package/dist/types/content/_internal/internalContentUtils.d.ts +2 -1
- package/dist/types/core/HubItemEntity.d.ts +1 -0
- package/dist/types/core/behaviors/IWithPermissionBehavior.d.ts +3 -0
- package/dist/types/core/traits/IWithPermissions.d.ts +9 -1
- package/dist/types/core/types/IHubItemEntity.d.ts +4 -0
- package/dist/types/core/types/ISystemStatus.d.ts +17 -0
- package/dist/types/core/types/index.d.ts +1 -0
- package/dist/types/discussions/_internal/DiscussionBusinessRules.d.ts +3 -1
- package/dist/types/groups/_internal/GroupBusinessRules.d.ts +3 -1
- package/dist/types/initiatives/_internal/InitiativeBusinessRules.d.ts +6 -2
- package/dist/types/pages/_internal/PageBusinessRules.d.ts +8 -2
- package/dist/types/permissions/_internal/checkAlphaGating.d.ts +1 -1
- package/dist/types/permissions/_internal/checkAvailability.d.ts +13 -0
- package/dist/types/permissions/_internal/checkEntityFeature.d.ts +4 -0
- package/dist/types/permissions/_internal/checkEnvironment.d.ts +13 -0
- package/dist/types/permissions/_internal/checkParents.d.ts +12 -0
- package/dist/types/permissions/_internal/checkServiceStatus.d.ts +4 -0
- package/dist/types/permissions/_internal/processEntityFeatures.d.ts +9 -0
- package/dist/types/permissions/types/IPermissionPolicy.d.ts +55 -4
- package/dist/types/permissions/types/PolicyResponse.d.ts +1 -1
- package/dist/types/projects/_internal/ProjectBusinessRules.d.ts +8 -2
- package/dist/types/sites/_internal/SiteBusinessRules.d.ts +9 -2
- package/dist/types/utils/getEnvironmentFromPortalUrl.d.ts +2 -0
- package/dist/types/utils/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IEntityPermissionPolicy } from "../../permissions";
|
|
1
|
+
import { IEntityFeatures, IEntityPermissionPolicy } from "../../permissions";
|
|
2
2
|
import { EntityCapabilities } from "../../capabilities";
|
|
3
3
|
/**
|
|
4
4
|
* Adds permissions property to an entity
|
|
@@ -8,5 +8,13 @@ export interface IWithPermissions {
|
|
|
8
8
|
* Array of permission policies that apply to the entity
|
|
9
9
|
*/
|
|
10
10
|
permissions?: IEntityPermissionPolicy[];
|
|
11
|
+
/**
|
|
12
|
+
* We need a means to enable / disable the "feature/capability" represented by a permission
|
|
13
|
+
* for an entity. e.g. we want to disable events for a site, so we have `hub:site:events`: false
|
|
14
|
+
*/
|
|
15
|
+
features?: IEntityFeatures;
|
|
16
|
+
/**
|
|
17
|
+
* DEPRECATEDL use `features` instead
|
|
18
|
+
*/
|
|
11
19
|
capabilities?: EntityCapabilities;
|
|
12
20
|
}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export declare type SystemStatus = "online" | "offline" | "maintenance" | "not-available";
|
|
5
5
|
/**
|
|
6
|
+
* DEPRECATED: use HubServiceStatus instead
|
|
6
7
|
* Hash of subsystems and their status
|
|
7
8
|
*/
|
|
8
9
|
export declare type HubSystemStatus = {
|
|
@@ -10,13 +11,29 @@ export declare type HubSystemStatus = {
|
|
|
10
11
|
};
|
|
11
12
|
declare const validSubsystems: readonly ["content", "discussions", "events", "initiatives", "items", "metrics", "notifications", "pages", "projects", "search", "sites", "groups", "platform"];
|
|
12
13
|
/**
|
|
14
|
+
* * DEPRECATED: use HubService instead
|
|
13
15
|
* Defines values for HubSubsystem
|
|
14
16
|
*/
|
|
15
17
|
export declare type HubSubsystem = (typeof validSubsystems)[number];
|
|
16
18
|
/**
|
|
19
|
+
* * DEPRECATED: use isHubService instead
|
|
17
20
|
* Validate a Subsystem
|
|
18
21
|
* @param subsystem
|
|
19
22
|
* @returns
|
|
20
23
|
*/
|
|
21
24
|
export declare function isSubsystem(maybeSubsystem: string): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Hash of subsystems and their status
|
|
27
|
+
*/
|
|
28
|
+
export declare type HubServiceStatus = {
|
|
29
|
+
[key in HubService]: SystemStatus;
|
|
30
|
+
};
|
|
31
|
+
declare const validServices: readonly ["portal", "discussions", "events", "metrics", "notifications", "hub-search", "domains"];
|
|
32
|
+
export declare type HubService = (typeof validServices)[number];
|
|
33
|
+
/**
|
|
34
|
+
* Validate a Service
|
|
35
|
+
* @param service
|
|
36
|
+
* @returns
|
|
37
|
+
*/
|
|
38
|
+
export declare function isHubService(maybeService: string): boolean;
|
|
22
39
|
export {};
|
|
@@ -8,6 +8,7 @@ export * from "./IHubDiscussion";
|
|
|
8
8
|
export * from "./IHubEditableContent";
|
|
9
9
|
export * from "./IHubEntityBase";
|
|
10
10
|
export * from "./IHubEvent";
|
|
11
|
+
export * from "./IHubGroup";
|
|
11
12
|
export * from "./IHubImage";
|
|
12
13
|
export * from "./IHubInitiative";
|
|
13
14
|
export * from "./IHubItemEntity";
|
|
@@ -5,12 +5,14 @@ import { IPermissionPolicy } from "../../permissions";
|
|
|
5
5
|
* This hash is combined with the capabilities hash stored in the item data. Regardless of what
|
|
6
6
|
* properties are defined in the item data, only the capabilities defined here will be available
|
|
7
7
|
* @private
|
|
8
|
+
* TODO: Remove capabilities
|
|
8
9
|
*/
|
|
9
10
|
export declare const DiscussionDefaultCapabilities: EntityCapabilities;
|
|
10
11
|
/**
|
|
11
12
|
* List of all the Discussion Capability Permissions
|
|
12
13
|
* These are considered Hub Business Rules and are not intended
|
|
13
14
|
* to be modified by consumers
|
|
15
|
+
* TODO: Remove capabilities
|
|
14
16
|
* @private
|
|
15
17
|
*/
|
|
16
18
|
export declare const DiscussionCapabilityPermissions: ICapabilityPermission[];
|
|
@@ -19,7 +21,7 @@ export declare const DiscussionCapabilityPermissions: ICapabilityPermission[];
|
|
|
19
21
|
* These define the requirements any user must meet to perform related actions
|
|
20
22
|
* @private
|
|
21
23
|
*/
|
|
22
|
-
export declare const DiscussionPermissions: readonly ["hub:discussion:create", "hub:discussion:delete", "hub:discussion:edit", "hub:discussion:view"];
|
|
24
|
+
export declare const DiscussionPermissions: readonly ["hub:discussion", "hub:discussion:create", "hub:discussion:delete", "hub:discussion:edit", "hub:discussion:view"];
|
|
23
25
|
/**
|
|
24
26
|
* Discussion permission policies
|
|
25
27
|
* @private
|
|
@@ -3,6 +3,7 @@ import { IPermissionPolicy } from "../../permissions";
|
|
|
3
3
|
/**
|
|
4
4
|
* Default capabilities for a Group.
|
|
5
5
|
* If not listed here, the capability will not be available
|
|
6
|
+
* TODO: Remove capabilities
|
|
6
7
|
* @private
|
|
7
8
|
*/
|
|
8
9
|
export declare const GroupDefaultCapabilities: EntityCapabilities;
|
|
@@ -10,6 +11,7 @@ export declare const GroupDefaultCapabilities: EntityCapabilities;
|
|
|
10
11
|
* List of all the Group Capability Permissions
|
|
11
12
|
* These are considered Hub Business Rules and are not intended
|
|
12
13
|
* to be modified by consumers
|
|
14
|
+
* TODO: Remove capabilities
|
|
13
15
|
* @private
|
|
14
16
|
*/
|
|
15
17
|
export declare const GroupCapabilityPermissions: ICapabilityPermission[];
|
|
@@ -18,7 +20,7 @@ export declare const GroupCapabilityPermissions: ICapabilityPermission[];
|
|
|
18
20
|
* These define the requirements any user must meet to perform related actions
|
|
19
21
|
* @private
|
|
20
22
|
*/
|
|
21
|
-
export declare const GroupPermissions: readonly ["hub:group:create", "hub:group:delete", "hub:group:edit", "hub:group:view", "hub:group:owner"];
|
|
23
|
+
export declare const GroupPermissions: readonly ["hub:group", "hub:group:create", "hub:group:delete", "hub:group:edit", "hub:group:view", "hub:group:owner"];
|
|
22
24
|
/**
|
|
23
25
|
* Group permission policies
|
|
24
26
|
* @private
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EntityCapabilities, ICapabilityPermission } from "../../capabilities";
|
|
2
|
-
import { IPermissionPolicy } from "../../permissions";
|
|
2
|
+
import { IEntityFeatures, IPermissionPolicy } from "../../permissions";
|
|
3
3
|
/**
|
|
4
4
|
* Default capabilities for a Initiative. If not listed here, the capability will not be available
|
|
5
5
|
* This hash is combined with the capabilities hash stored in the item data. Regardless of what
|
|
@@ -14,12 +14,16 @@ export declare const InitiativeDefaultCapabilities: EntityCapabilities;
|
|
|
14
14
|
* @private
|
|
15
15
|
*/
|
|
16
16
|
export declare const InitiativeCapabilityPermissions: ICapabilityPermission[];
|
|
17
|
+
/**
|
|
18
|
+
* Default features for a Initiative. These are the features that can be enabled / disabled by the entity owner
|
|
19
|
+
*/
|
|
20
|
+
export declare const InitiativeDefaultFeatures: IEntityFeatures;
|
|
17
21
|
/**
|
|
18
22
|
* Initiative Permission Policies
|
|
19
23
|
* These define the requirements any user must meet to perform related actions
|
|
20
24
|
* @private
|
|
21
25
|
*/
|
|
22
|
-
export declare const InitiativePermissions: readonly ["hub:initiative:create", "hub:initiative:delete", "hub:initiative:edit", "hub:initiative:view"];
|
|
26
|
+
export declare const InitiativePermissions: readonly ["hub:initiative", "hub:initiative:create", "hub:initiative:delete", "hub:initiative:edit", "hub:initiative:view", "hub:initiative:events", "hub:initiative:content", "hub:initiative:discussions"];
|
|
23
27
|
/**
|
|
24
28
|
* Initiative permission policies
|
|
25
29
|
* @private
|
|
@@ -1,25 +1,31 @@
|
|
|
1
1
|
import { EntityCapabilities, ICapabilityPermission } from "../../capabilities";
|
|
2
|
-
import { IPermissionPolicy } from "../../permissions";
|
|
2
|
+
import { IEntityFeatures, IPermissionPolicy } from "../../permissions";
|
|
3
3
|
/**
|
|
4
4
|
* Default capabilities for a Page. If not listed here, the capability will not be available
|
|
5
5
|
* This hash is combined with the capabilities hash stored in the item data. Regardless of what
|
|
6
6
|
* properties are defined in the item data, only the capabilities defined here will be available
|
|
7
7
|
* @private
|
|
8
|
+
* TODO: Remove capabilities
|
|
8
9
|
*/
|
|
9
10
|
export declare const PageDefaultCapabilities: EntityCapabilities;
|
|
10
11
|
/**
|
|
11
12
|
* List of all the Page Capability Permissions
|
|
12
13
|
* These are considered Hub Business Rules and are not intended
|
|
13
14
|
* to be modified by consumers
|
|
15
|
+
* TODO: Remove capabilities
|
|
14
16
|
* @private
|
|
15
17
|
*/
|
|
16
18
|
export declare const PageCapabilityPermissions: ICapabilityPermission[];
|
|
19
|
+
/**
|
|
20
|
+
* Default features for a Project. These are the features that can be enabled / disabled by the entity owner
|
|
21
|
+
*/
|
|
22
|
+
export declare const PageDefaultFeatures: IEntityFeatures;
|
|
17
23
|
/**
|
|
18
24
|
* Page Permission Policies
|
|
19
25
|
* These define the requirements any user must meet to perform related actions
|
|
20
26
|
* @private
|
|
21
27
|
*/
|
|
22
|
-
export declare const PagePermissions: readonly ["hub:page:create", "hub:page:delete", "hub:page:edit", "hub:page:view"];
|
|
28
|
+
export declare const PagePermissions: readonly ["hub:page", "hub:page:create", "hub:page:delete", "hub:page:edit", "hub:page:view"];
|
|
23
29
|
/**
|
|
24
30
|
* Page permission policies
|
|
25
31
|
* @private
|
|
@@ -7,4 +7,4 @@ import { IPermissionPolicy, IPolicyCheck } from "../types";
|
|
|
7
7
|
* @param entity
|
|
8
8
|
* @returns
|
|
9
9
|
*/
|
|
10
|
-
export declare function checkAlphaGating(policy: IPermissionPolicy, context: IArcGISContext,
|
|
10
|
+
export declare function checkAlphaGating(policy: IPermissionPolicy, context: IArcGISContext, _entity?: Record<string, any>): IPolicyCheck[];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IArcGISContext } from "../../ArcGISContext";
|
|
2
|
+
import { IPermissionPolicy } from "../types/IPermissionPolicy";
|
|
3
|
+
import { IPolicyCheck } from "../types/IPolicyCheck";
|
|
4
|
+
/**
|
|
5
|
+
* @internal
|
|
6
|
+
* Verify that the policy.availability requirement is met.
|
|
7
|
+
* If a value is specified in the policy, the current context must be one of those values.
|
|
8
|
+
* @param policy
|
|
9
|
+
* @param context
|
|
10
|
+
* @param entity
|
|
11
|
+
* @returns
|
|
12
|
+
*/
|
|
13
|
+
export declare function checkAvailability(policy: IPermissionPolicy, context: IArcGISContext, _entity?: Record<string, any>): IPolicyCheck[];
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { IArcGISContext } from "../../ArcGISContext";
|
|
2
|
+
import { IPermissionPolicy } from "../types/IPermissionPolicy";
|
|
3
|
+
import { IPolicyCheck } from "../types/IPolicyCheck";
|
|
4
|
+
export declare function checkEntityFeature(policy: IPermissionPolicy, _entitycontext: IArcGISContext, entity?: Record<string, any>): IPolicyCheck[];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IArcGISContext } from "../../ArcGISContext";
|
|
2
|
+
import { IPermissionPolicy } from "../types/IPermissionPolicy";
|
|
3
|
+
import { IPolicyCheck } from "../types/IPolicyCheck";
|
|
4
|
+
/**
|
|
5
|
+
* @internal
|
|
6
|
+
* Verify that the policy.environment requirement is met.
|
|
7
|
+
*
|
|
8
|
+
* @param policy
|
|
9
|
+
* @param context
|
|
10
|
+
* @param entity
|
|
11
|
+
* @returns
|
|
12
|
+
*/
|
|
13
|
+
export declare function checkEnvironment(policy: IPermissionPolicy, context: IArcGISContext, _entity?: Record<string, any>): IPolicyCheck[];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IArcGISContext } from "../../ArcGISContext";
|
|
2
|
+
import { IPermissionPolicy } from "../types/IPermissionPolicy";
|
|
3
|
+
import { IPolicyCheck } from "../types/IPolicyCheck";
|
|
4
|
+
/**
|
|
5
|
+
* @internal
|
|
6
|
+
* Check the parent policies for the given policy
|
|
7
|
+
* @param policy
|
|
8
|
+
* @param context
|
|
9
|
+
* @param entity
|
|
10
|
+
* @returns
|
|
11
|
+
*/
|
|
12
|
+
export declare function checkParents(policy: IPermissionPolicy, context: IArcGISContext, entity?: Record<string, any>): IPolicyCheck[];
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { IArcGISContext } from "../../ArcGISContext";
|
|
2
|
+
import { IPermissionPolicy } from "../types/IPermissionPolicy";
|
|
3
|
+
import { IPolicyCheck } from "../types/IPolicyCheck";
|
|
4
|
+
export declare function checkServiceStatus(policy: IPermissionPolicy, context: IArcGISContext, _entity?: Record<string, any>): IPolicyCheck[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IEntityFeatures } from "../types/IPermissionPolicy";
|
|
2
|
+
/**
|
|
3
|
+
* Take an entity's features and merge them with the default features ensuring
|
|
4
|
+
* that only the featires defined in the business rules are allowed through.
|
|
5
|
+
* @param entityFeatures
|
|
6
|
+
* @param defaultFeatures
|
|
7
|
+
* @returns
|
|
8
|
+
*/
|
|
9
|
+
export declare function processEntityFeatures(entityFeatures: IEntityFeatures, defaultFeatures: IEntityFeatures): IEntityFeatures;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HubLicense } from "./HubLicense";
|
|
2
|
-
import { HubSubsystem } from "../../core/types/ISystemStatus";
|
|
2
|
+
import { HubService, HubSubsystem } from "../../core/types/ISystemStatus";
|
|
3
3
|
import { Permission } from "./Permission";
|
|
4
4
|
import { PlatformPrivilege } from "./PlatformPrivilege";
|
|
5
5
|
/**
|
|
@@ -14,9 +14,17 @@ export interface IPermissionPolicy {
|
|
|
14
14
|
*/
|
|
15
15
|
permission: Permission;
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* Parent permissions this permission is dependent on
|
|
18
18
|
*/
|
|
19
|
-
|
|
19
|
+
dependencies?: Permission[];
|
|
20
|
+
/**
|
|
21
|
+
* DEPRECATED: What subsystems are required to be online for this permission to be granted
|
|
22
|
+
*/
|
|
23
|
+
subsystems?: HubSubsystem[];
|
|
24
|
+
/**
|
|
25
|
+
* What services are required to be online for this permission to be granted
|
|
26
|
+
*/
|
|
27
|
+
services?: HubService[];
|
|
20
28
|
/**
|
|
21
29
|
* Must the user authenticated?
|
|
22
30
|
*/
|
|
@@ -27,11 +35,25 @@ export interface IPermissionPolicy {
|
|
|
27
35
|
* e.g. If a user is in a Partner "hub-basic" org, they can not create "premium" entities (e.g. Projects)
|
|
28
36
|
*/
|
|
29
37
|
licenses?: HubLicense[];
|
|
38
|
+
/**
|
|
39
|
+
* Is this permission gated to a specific availability?
|
|
40
|
+
* This is used to limit access to features that are not yet available in production
|
|
41
|
+
*/
|
|
42
|
+
availability?: HubAvailability[];
|
|
43
|
+
/**
|
|
44
|
+
* Is this permission gated to a specific environment? (e.g. devext, qaext)
|
|
45
|
+
* This is used to limit access to features that are not yet available in production
|
|
46
|
+
*/
|
|
47
|
+
environments?: HubEnvironment[];
|
|
30
48
|
/**
|
|
31
49
|
* Any platform level privileges required for this permission to be granted
|
|
32
50
|
* e.g. "portal:user:createItem"
|
|
33
51
|
*/
|
|
34
52
|
privileges?: PlatformPrivilege[];
|
|
53
|
+
/**
|
|
54
|
+
* Can an entity provide additional conditions to further limit access?
|
|
55
|
+
*/
|
|
56
|
+
entityConfigurable?: boolean;
|
|
35
57
|
/**
|
|
36
58
|
* Is the user an owner of the entity being accessed?
|
|
37
59
|
*/
|
|
@@ -41,17 +63,46 @@ export interface IPermissionPolicy {
|
|
|
41
63
|
*/
|
|
42
64
|
entityOwner?: boolean;
|
|
43
65
|
/**
|
|
44
|
-
*
|
|
66
|
+
* DEPRECATED: Use `gatedAvailability: "alpha"` instead
|
|
45
67
|
*/
|
|
46
68
|
alpha?: boolean;
|
|
47
69
|
/**
|
|
48
70
|
* More complex policies can be defined with a set of assertions
|
|
49
71
|
*/
|
|
50
72
|
assertions?: IPolicyAssertion[];
|
|
73
|
+
/**
|
|
74
|
+
* Value set by the feature flagging system to override the default permission behavior. This can be used to
|
|
75
|
+
* demo features to specific users or groups, during a specific user session.
|
|
76
|
+
* If `true`, the permission will be granted as long as the license and privilege requirements are met.
|
|
77
|
+
* If `false`, the permission will be denied for all users - typically as a means to check for graceful degradation
|
|
78
|
+
* if a system is offline.
|
|
79
|
+
*/
|
|
80
|
+
flagValue?: boolean;
|
|
51
81
|
}
|
|
82
|
+
/**
|
|
83
|
+
* Hash of features for an entity which can be used to determine if a feature is enabled for the entity
|
|
84
|
+
* This can be applied to any permissin, enabling a lot of flexibility in how features are described and enabled
|
|
85
|
+
* If the value is set to false, then the permission will alway be set to false for all users.
|
|
86
|
+
*/
|
|
87
|
+
export interface IEntityFeatures extends Record<Permission, boolean> {
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Hub Availability levels
|
|
91
|
+
*/
|
|
92
|
+
export declare type HubAvailability = "alpha" | "beta" | "general";
|
|
93
|
+
/**
|
|
94
|
+
* Hub Run-time environments
|
|
95
|
+
*/
|
|
96
|
+
export declare type HubEnvironment = "devext" | "qaext" | "production" | "enterprise" | "enterprise-k8s";
|
|
97
|
+
/**
|
|
98
|
+
* Assertion used to define more complex permission policies
|
|
99
|
+
*/
|
|
52
100
|
export interface IPolicyAssertion {
|
|
53
101
|
property: string;
|
|
54
102
|
type: AssertionType;
|
|
55
103
|
value: any;
|
|
56
104
|
}
|
|
105
|
+
/**
|
|
106
|
+
* Assertion types which define the comparison operation to be performed
|
|
107
|
+
*/
|
|
57
108
|
export declare type AssertionType = "eq" | "neq" | "gt" | "lt" | "contains" | "contains-all" | "without" | "included-in" | "is-group-admin" | "is-group-member" | "is-group-owner" | "starts-with" | "ends-with" | "not-starts-with" | "not-ends-with";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/**`
|
|
2
2
|
* Human readable response from a policy check
|
|
3
3
|
*/
|
|
4
|
-
export declare type PolicyResponse = "granted" | "org-member" | "not-org-member" | "group-member" | "not-group-member" | "not-group-admin" | "is-user" | "not-owner" | "not-licensed" | "not-licensed-available" | "not-available" | "not-granted" | "no-edit-access" | "edit-access" | "invalid-permission" | "invalid-capability" | "privilege-required" | "system-offline" | "system-maintenance" | "entity-required" | "not-authenticated" | "not-alpha-org" | "property-missing" | "property-not-array" | "array-contains-invalid-value" | "array-missing-required-value" | "property-mismatch" | "user-not-group-member" | "user-not-group-manager" | "user-not-group-owner" | "assertion-property-not-found" | "assertion-failed" | "assertion-requires-numeric-values" | "property-match";
|
|
4
|
+
export declare type PolicyResponse = "granted" | "org-member" | "not-org-member" | "group-member" | "not-group-member" | "not-group-admin" | "is-user" | "not-owner" | "not-licensed" | "not-licensed-available" | "not-available" | "not-granted" | "no-edit-access" | "edit-access" | "invalid-permission" | "invalid-capability" | "privilege-required" | "system-offline" | "system-maintenance" | "service-offline" | "service-maintenance" | "service-not-available" | "entity-required" | "not-authenticated" | "not-alpha-org" | "not-beta-org" | "property-missing" | "property-not-array" | "array-contains-invalid-value" | "array-missing-required-value" | "property-mismatch" | "user-not-group-member" | "user-not-group-manager" | "user-not-group-owner" | "assertion-property-not-found" | "assertion-failed" | "assertion-requires-numeric-values" | "property-match" | "feature-disabled" | "feature-enabled" | "not-in-environment";
|
|
@@ -1,25 +1,31 @@
|
|
|
1
1
|
import { EntityCapabilities, ICapabilityPermission } from "../../capabilities";
|
|
2
|
-
import { IPermissionPolicy } from "../../permissions";
|
|
2
|
+
import { IEntityFeatures, IPermissionPolicy } from "../../permissions";
|
|
3
3
|
/**
|
|
4
4
|
* Default capabilities for a Project. If not listed here, the capability will not be available
|
|
5
5
|
* This hash is combined with the capabilities hash stored in the item data. Regardless of what
|
|
6
6
|
* properties are defined in the item data, only the capabilities defined here will be available
|
|
7
7
|
* @private
|
|
8
|
+
* TODO: Remove capabilities
|
|
8
9
|
*/
|
|
9
10
|
export declare const ProjectDefaultCapabilities: EntityCapabilities;
|
|
10
11
|
/**
|
|
11
12
|
* List of all the Project Capability Permissions
|
|
12
13
|
* These are considered Hub Business Rules and are not intended
|
|
13
14
|
* to be modified by consumers
|
|
15
|
+
* TODO: Remove capabilities
|
|
14
16
|
* @private
|
|
15
17
|
*/
|
|
16
18
|
export declare const ProjectCapabilityPermissions: ICapabilityPermission[];
|
|
19
|
+
/**
|
|
20
|
+
* Default features for a Project. These are the features that can be enabled / disabled by the entity owner
|
|
21
|
+
*/
|
|
22
|
+
export declare const ProjectDefaultFeatures: IEntityFeatures;
|
|
17
23
|
/**
|
|
18
24
|
* Project Permission Policies
|
|
19
25
|
* These define the requirements any user must meet to perform related actions
|
|
20
26
|
* @private
|
|
21
27
|
*/
|
|
22
|
-
export declare const ProjectPermissions: readonly ["hub:project:create", "hub:project:delete", "hub:project:edit", "hub:project:view", "hub:project:owner"];
|
|
28
|
+
export declare const ProjectPermissions: readonly ["hub:project", "hub:project:create", "hub:project:delete", "hub:project:edit", "hub:project:view", "hub:project:owner", "hub:project:events", "hub:project:content", "hub:project:discussions"];
|
|
23
29
|
/**
|
|
24
30
|
* Project permission policies
|
|
25
31
|
* @private
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { EntityCapabilities, ICapabilityPermission } from "../../capabilities";
|
|
2
|
-
import { IPermissionPolicy } from "../../permissions/types";
|
|
2
|
+
import { IEntityFeatures, IPermissionPolicy } from "../../permissions/types";
|
|
3
3
|
/**
|
|
4
|
+
* DEPRECATED
|
|
4
5
|
* Default capabilities for a Site. If not listed here, the capability will not be available
|
|
5
6
|
* This hash is combined with the capabilities hash stored in the item data. Regardless of what
|
|
6
7
|
* properties are defined in the item data, only the capabilities defined here will be available
|
|
@@ -8,16 +9,22 @@ import { IPermissionPolicy } from "../../permissions/types";
|
|
|
8
9
|
*/
|
|
9
10
|
export declare const SiteDefaultCapabilities: EntityCapabilities;
|
|
10
11
|
/**
|
|
12
|
+
* DEPRECATED
|
|
11
13
|
* List of all the Site Capability Permissions
|
|
12
14
|
* These are considered Hub Business Rules and are not intended
|
|
13
15
|
* to be modified by consumers
|
|
16
|
+
* @private
|
|
14
17
|
*/
|
|
15
18
|
export declare const SiteCapabilityPermissions: ICapabilityPermission[];
|
|
19
|
+
/**
|
|
20
|
+
* Default features for a Site. These are the features that can be enabled / disabled by the entity owner
|
|
21
|
+
*/
|
|
22
|
+
export declare const SiteDefaultFeatures: IEntityFeatures;
|
|
16
23
|
/**
|
|
17
24
|
* Site Permissions
|
|
18
25
|
* This feeds into the Permissions type
|
|
19
26
|
*/
|
|
20
|
-
export declare const SitePermissions: readonly ["hub:site:create", "hub:site:delete", "hub:site:edit", "hub:site:view"];
|
|
27
|
+
export declare const SitePermissions: readonly ["hub:site", "hub:site:create", "hub:site:delete", "hub:site:edit", "hub:site:view", "hub:site:owner", "hub:site:events", "hub:site:content", "hub:site:discussions"];
|
|
21
28
|
/**
|
|
22
29
|
* Site permission policies
|
|
23
30
|
* @private
|