@esri/hub-common 12.0.0-alpha.1 → 12.0.0-alpha.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/dist/esm/ArcGISContext.js +14 -0
- package/dist/esm/ArcGISContext.js.map +1 -1
- package/dist/esm/capabilities/_internal/checkCapabilityAccess.js +47 -0
- package/dist/esm/capabilities/_internal/checkCapabilityAccess.js.map +1 -0
- package/dist/esm/capabilities/_internal/index.js +2 -0
- package/dist/esm/capabilities/_internal/index.js.map +1 -0
- package/dist/esm/capabilities/checkCapability.js +46 -0
- package/dist/esm/capabilities/checkCapability.js.map +1 -0
- package/dist/esm/capabilities/getWorkspaceCapabilities.js +38 -0
- package/dist/esm/capabilities/getWorkspaceCapabilities.js.map +1 -0
- package/dist/esm/capabilities/index.js +5 -0
- package/dist/esm/capabilities/index.js.map +1 -0
- package/dist/esm/capabilities/processEntityCapabilities.js +25 -0
- package/dist/esm/capabilities/processEntityCapabilities.js.map +1 -0
- package/dist/esm/capabilities/types.js +22 -0
- package/dist/esm/capabilities/types.js.map +1 -0
- package/dist/esm/core/HubItemEntity.js +8 -0
- package/dist/esm/core/HubItemEntity.js.map +1 -1
- package/dist/esm/{permissions → core}/types/IAccessResponse.js +0 -0
- package/dist/esm/core/types/IAccessResponse.js.map +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/initiatives/HubInitiative.js.map +1 -1
- package/dist/esm/initiatives/HubInitiatives.js +2 -36
- package/dist/esm/initiatives/HubInitiatives.js.map +1 -1
- package/dist/esm/initiatives/_internal/InitiativeBusinessRules.js +79 -0
- package/dist/esm/initiatives/_internal/InitiativeBusinessRules.js.map +1 -0
- package/dist/esm/initiatives/_internal/computeProps.js +31 -0
- package/dist/esm/initiatives/_internal/computeProps.js.map +1 -0
- package/dist/esm/initiatives/_internal/getPropertyMap.js +22 -0
- package/dist/esm/initiatives/_internal/getPropertyMap.js.map +1 -0
- package/dist/esm/permissions/HubPermissionPolicies.js +57 -2
- package/dist/esm/permissions/HubPermissionPolicies.js.map +1 -1
- package/dist/esm/permissions/_internal/checkAlphaGating.js +27 -0
- package/dist/esm/permissions/_internal/checkAlphaGating.js.map +1 -0
- package/dist/esm/permissions/_internal/checkAssertion.js +190 -0
- package/dist/esm/permissions/_internal/checkAssertion.js.map +1 -0
- package/dist/esm/permissions/_internal/checkAssertions.js +20 -0
- package/dist/esm/permissions/_internal/checkAssertions.js.map +1 -0
- package/dist/esm/permissions/_internal/checkAuthentication.js +15 -11
- package/dist/esm/permissions/_internal/checkAuthentication.js.map +1 -1
- package/dist/esm/permissions/_internal/checkEdit.js +6 -3
- package/dist/esm/permissions/_internal/checkEdit.js.map +1 -1
- package/dist/esm/permissions/_internal/checkEntityPolicy.js +14 -2
- package/dist/esm/permissions/_internal/checkEntityPolicy.js.map +1 -1
- package/dist/esm/permissions/_internal/checkLicense.js +21 -15
- package/dist/esm/permissions/_internal/checkLicense.js.map +1 -1
- package/dist/esm/permissions/_internal/checkOwner.js.map +1 -1
- package/dist/esm/permissions/_internal/checkPrivileges.js +19 -15
- package/dist/esm/permissions/_internal/checkPrivileges.js.map +1 -1
- package/dist/esm/permissions/_internal/getPolicyResponseCode.js +34 -16
- package/dist/esm/permissions/_internal/getPolicyResponseCode.js.map +1 -1
- package/dist/esm/permissions/checkPermission.js +6 -4
- package/dist/esm/permissions/checkPermission.js.map +1 -1
- package/dist/esm/permissions/types/IPermissionAccessResponse.js +1 -0
- package/dist/esm/permissions/types/IPermissionAccessResponse.js.map +1 -0
- package/dist/esm/permissions/types/Permission.js +8 -10
- package/dist/esm/permissions/types/Permission.js.map +1 -1
- package/dist/esm/permissions/types/index.js +1 -1
- package/dist/esm/permissions/types/index.js.map +1 -1
- package/dist/esm/projects/HubProject.js.map +1 -1
- package/dist/esm/projects/_internal/ProjectBusinessRules.js +79 -0
- package/dist/esm/projects/_internal/ProjectBusinessRules.js.map +1 -0
- package/dist/esm/projects/{_internal.js → _internal/computeProps.js} +7 -19
- package/dist/esm/projects/_internal/computeProps.js.map +1 -0
- package/dist/esm/projects/_internal/getPropertyMap.js +22 -0
- package/dist/esm/projects/_internal/getPropertyMap.js.map +1 -0
- package/dist/esm/projects/defaults.js +1 -0
- package/dist/esm/projects/defaults.js.map +1 -1
- package/dist/esm/projects/edit.js +2 -1
- package/dist/esm/projects/edit.js.map +1 -1
- package/dist/esm/projects/fetch.js +2 -1
- package/dist/esm/projects/fetch.js.map +1 -1
- package/dist/esm/sites/HubSites.js +16 -84
- package/dist/esm/sites/HubSites.js.map +1 -1
- package/dist/esm/sites/_internal/SiteBusinessRules.js +77 -0
- package/dist/esm/sites/_internal/SiteBusinessRules.js.map +1 -0
- package/dist/esm/sites/_internal/applyPermissionMigration.js +52 -0
- package/dist/esm/sites/_internal/applyPermissionMigration.js.map +1 -0
- package/dist/esm/sites/_internal/computeProps.js +32 -0
- package/dist/esm/sites/_internal/computeProps.js.map +1 -0
- package/dist/esm/sites/_internal/getPropertyMap.js +59 -0
- package/dist/esm/sites/_internal/getPropertyMap.js.map +1 -0
- package/dist/node/ArcGISContext.js +14 -0
- package/dist/node/ArcGISContext.js.map +1 -1
- package/dist/node/capabilities/_internal/checkCapabilityAccess.js +51 -0
- package/dist/node/capabilities/_internal/checkCapabilityAccess.js.map +1 -0
- package/dist/node/capabilities/_internal/index.js +5 -0
- package/dist/node/capabilities/_internal/index.js.map +1 -0
- package/dist/node/capabilities/checkCapability.js +50 -0
- package/dist/node/capabilities/checkCapability.js.map +1 -0
- package/dist/node/capabilities/getWorkspaceCapabilities.js +42 -0
- package/dist/node/capabilities/getWorkspaceCapabilities.js.map +1 -0
- package/dist/node/capabilities/index.js +8 -0
- package/dist/node/capabilities/index.js.map +1 -0
- package/dist/node/capabilities/processEntityCapabilities.js +29 -0
- package/dist/node/capabilities/processEntityCapabilities.js.map +1 -0
- package/dist/node/capabilities/types.js +26 -0
- package/dist/node/capabilities/types.js.map +1 -0
- package/dist/node/core/HubItemEntity.js +8 -0
- package/dist/node/core/HubItemEntity.js.map +1 -1
- package/dist/node/{permissions → core}/types/IAccessResponse.js +0 -0
- package/dist/node/core/types/IAccessResponse.js.map +1 -0
- package/dist/node/index.js +1 -0
- package/dist/node/index.js.map +1 -1
- package/dist/node/initiatives/HubInitiative.js.map +1 -1
- package/dist/node/initiatives/HubInitiatives.js +8 -42
- package/dist/node/initiatives/HubInitiatives.js.map +1 -1
- package/dist/node/initiatives/_internal/InitiativeBusinessRules.js +82 -0
- package/dist/node/initiatives/_internal/InitiativeBusinessRules.js.map +1 -0
- package/dist/node/initiatives/_internal/computeProps.js +35 -0
- package/dist/node/initiatives/_internal/computeProps.js.map +1 -0
- package/dist/node/initiatives/_internal/getPropertyMap.js +26 -0
- package/dist/node/initiatives/_internal/getPropertyMap.js.map +1 -0
- package/dist/node/permissions/HubPermissionPolicies.js +59 -4
- package/dist/node/permissions/HubPermissionPolicies.js.map +1 -1
- package/dist/node/permissions/_internal/checkAlphaGating.js +31 -0
- package/dist/node/permissions/_internal/checkAlphaGating.js.map +1 -0
- package/dist/node/permissions/_internal/checkAssertion.js +194 -0
- package/dist/node/permissions/_internal/checkAssertion.js.map +1 -0
- package/dist/node/permissions/_internal/checkAssertions.js +24 -0
- package/dist/node/permissions/_internal/checkAssertions.js.map +1 -0
- package/dist/node/permissions/_internal/checkAuthentication.js +15 -11
- package/dist/node/permissions/_internal/checkAuthentication.js.map +1 -1
- package/dist/node/permissions/_internal/checkEdit.js +6 -3
- package/dist/node/permissions/_internal/checkEdit.js.map +1 -1
- package/dist/node/permissions/_internal/checkEntityPolicy.js +14 -2
- package/dist/node/permissions/_internal/checkEntityPolicy.js.map +1 -1
- package/dist/node/permissions/_internal/checkLicense.js +21 -15
- package/dist/node/permissions/_internal/checkLicense.js.map +1 -1
- package/dist/node/permissions/_internal/checkOwner.js.map +1 -1
- package/dist/node/permissions/_internal/checkPrivileges.js +19 -15
- package/dist/node/permissions/_internal/checkPrivileges.js.map +1 -1
- package/dist/node/permissions/_internal/getPolicyResponseCode.js +34 -16
- package/dist/node/permissions/_internal/getPolicyResponseCode.js.map +1 -1
- package/dist/node/permissions/checkPermission.js +6 -4
- package/dist/node/permissions/checkPermission.js.map +1 -1
- package/dist/node/permissions/types/IPermissionAccessResponse.js +3 -0
- package/dist/node/permissions/types/IPermissionAccessResponse.js.map +1 -0
- package/dist/node/permissions/types/Permission.js +8 -10
- package/dist/node/permissions/types/Permission.js.map +1 -1
- package/dist/node/permissions/types/index.js +1 -1
- package/dist/node/permissions/types/index.js.map +1 -1
- package/dist/node/projects/HubProject.js.map +1 -1
- package/dist/node/projects/_internal/ProjectBusinessRules.js +82 -0
- package/dist/node/projects/_internal/ProjectBusinessRules.js.map +1 -0
- package/dist/node/projects/{_internal.js → _internal/computeProps.js} +8 -21
- package/dist/node/projects/_internal/computeProps.js.map +1 -0
- package/dist/node/projects/_internal/getPropertyMap.js +26 -0
- package/dist/node/projects/_internal/getPropertyMap.js.map +1 -0
- package/dist/node/projects/defaults.js +1 -0
- package/dist/node/projects/defaults.js.map +1 -1
- package/dist/node/projects/edit.js +6 -5
- package/dist/node/projects/edit.js.map +1 -1
- package/dist/node/projects/fetch.js +4 -3
- package/dist/node/projects/fetch.js.map +1 -1
- package/dist/node/sites/HubSites.js +16 -84
- package/dist/node/sites/HubSites.js.map +1 -1
- package/dist/node/sites/_internal/SiteBusinessRules.js +80 -0
- package/dist/node/sites/_internal/SiteBusinessRules.js.map +1 -0
- package/dist/node/sites/_internal/applyPermissionMigration.js +56 -0
- package/dist/node/sites/_internal/applyPermissionMigration.js.map +1 -0
- package/dist/node/sites/_internal/computeProps.js +36 -0
- package/dist/node/sites/_internal/computeProps.js.map +1 -0
- package/dist/node/sites/_internal/getPropertyMap.js +63 -0
- package/dist/node/sites/_internal/getPropertyMap.js.map +1 -0
- package/dist/types/ArcGISContext.d.ts +10 -0
- package/dist/types/capabilities/_internal/checkCapabilityAccess.d.ts +10 -0
- package/dist/types/capabilities/_internal/index.d.ts +1 -0
- package/dist/types/capabilities/checkCapability.d.ts +10 -0
- package/dist/types/capabilities/getWorkspaceCapabilities.d.ts +15 -0
- package/dist/types/capabilities/index.d.ts +4 -0
- package/dist/types/capabilities/processEntityCapabilities.d.ts +8 -0
- package/dist/types/capabilities/types.d.ts +57 -0
- package/dist/types/content/_internal.d.ts +2 -1
- package/dist/types/core/HubItemEntity.d.ts +10 -4
- package/dist/types/core/behaviors/IWithPermissionBehavior.d.ts +10 -2
- package/dist/types/core/traits/IWithPermissions.d.ts +2 -0
- package/dist/types/core/types/IAccessResponse.d.ts +20 -0
- package/dist/types/core/types/IHubSite.d.ts +4 -4
- package/dist/types/index.d.ts +1 -0
- package/dist/types/initiatives/HubInitiative.d.ts +2 -2
- package/dist/types/initiatives/_internal/InitiativeBusinessRules.d.ts +26 -0
- package/dist/types/initiatives/_internal/computeProps.d.ts +12 -0
- package/dist/types/initiatives/_internal/getPropertyMap.d.ts +8 -0
- package/dist/types/permissions/_internal/checkAlphaGating.d.ts +10 -0
- package/dist/types/permissions/_internal/checkAssertion.d.ts +11 -0
- package/dist/types/permissions/_internal/checkAssertions.d.ts +10 -0
- package/dist/types/permissions/_internal/checkAuthentication.d.ts +1 -2
- package/dist/types/permissions/_internal/checkEdit.d.ts +1 -2
- package/dist/types/permissions/_internal/checkLicense.d.ts +1 -1
- package/dist/types/permissions/_internal/checkOwner.d.ts +1 -2
- package/dist/types/permissions/_internal/checkPrivileges.d.ts +1 -2
- package/dist/types/permissions/checkPermission.d.ts +2 -3
- package/dist/types/permissions/types/IEntityPermissionPolicy.d.ts +1 -1
- package/dist/types/permissions/types/IPermissionAccessResponse.d.ts +18 -0
- package/dist/types/permissions/types/IPermissionPolicy.d.ts +18 -9
- package/dist/types/permissions/types/Permission.d.ts +3 -3
- package/dist/types/permissions/types/PolicyResponse.d.ts +1 -1
- package/dist/types/permissions/types/index.d.ts +1 -1
- package/dist/types/projects/HubProject.d.ts +2 -2
- package/dist/types/projects/_internal/ProjectBusinessRules.d.ts +26 -0
- package/dist/types/projects/{_internal.d.ts → _internal/computeProps.d.ts} +2 -10
- package/dist/types/projects/_internal/getPropertyMap.d.ts +8 -0
- package/dist/types/sites/HubSites.d.ts +1 -1
- package/dist/types/sites/_internal/SiteBusinessRules.d.ts +25 -0
- package/dist/types/sites/_internal/applyPermissionMigration.d.ts +7 -0
- package/dist/types/sites/_internal/computeProps.d.ts +12 -0
- package/dist/types/sites/_internal/getPropertyMap.d.ts +10 -0
- package/package.json +1 -1
- package/dist/esm/permissions/types/IAccessResponse.js.map +0 -1
- package/dist/esm/projects/_internal/ProjectPermissionPolicies.js +0 -35
- package/dist/esm/projects/_internal/ProjectPermissionPolicies.js.map +0 -1
- package/dist/esm/projects/_internal.js.map +0 -1
- package/dist/esm/sites/_internal/SitesPermissionPolicies.js +0 -34
- package/dist/esm/sites/_internal/SitesPermissionPolicies.js.map +0 -1
- package/dist/node/permissions/types/IAccessResponse.js.map +0 -1
- package/dist/node/projects/_internal/ProjectPermissionPolicies.js +0 -38
- package/dist/node/projects/_internal/ProjectPermissionPolicies.js.map +0 -1
- package/dist/node/projects/_internal.js.map +0 -1
- package/dist/node/sites/_internal/SitesPermissionPolicies.js +0 -37
- package/dist/node/sites/_internal/SitesPermissionPolicies.js.map +0 -1
- package/dist/types/permissions/types/IAccessResponse.d.ts +0 -29
- package/dist/types/projects/_internal/ProjectPermissionPolicies.d.ts +0 -7
- package/dist/types/sites/_internal/SitesPermissionPolicies.d.ts +0 -6
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { EntityCapabilities } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Take an entity's capabilities and merge them with the default capabilities ensuring that only the capabilities defined in the business rules are allowed through.
|
|
4
|
+
* @param entityCapabilities
|
|
5
|
+
* @param defaultCapabilities
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
export declare function processEntityCapabilities(entityCapabilities: EntityCapabilities, defaultCapabilities: EntityCapabilities): EntityCapabilities;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { HubEntityType, IPermissionAccessResponse, Permission } from "../index";
|
|
2
|
+
import { IAccessResponse } from "../core/types/IAccessResponse";
|
|
3
|
+
/**
|
|
4
|
+
* Hub System Capabilities
|
|
5
|
+
*/
|
|
6
|
+
declare const validCapabilities: readonly ["collaboration", "details", "discussions", "events", "followers", "overview", "settings", "teams"];
|
|
7
|
+
/**
|
|
8
|
+
* Defines the possible values for Capability
|
|
9
|
+
*/
|
|
10
|
+
export declare type Capability = typeof validCapabilities[number];
|
|
11
|
+
/**
|
|
12
|
+
* Validate a capability. This is used because the libary can be used outside of typescript and we want to be able to return a message is the string passed in is not a valid capability
|
|
13
|
+
* @param Capability
|
|
14
|
+
* @returns
|
|
15
|
+
*/
|
|
16
|
+
export declare function isCapability(maybeCapability: string): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Hash of with keys constrained to Capability
|
|
19
|
+
*/
|
|
20
|
+
export declare type EntityCapabilities = {
|
|
21
|
+
[key in Capability]?: boolean;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Defines the permissions required to access a specific capability, for a specific entity type
|
|
25
|
+
*/
|
|
26
|
+
export interface ICapabilityPermission {
|
|
27
|
+
entity: HubEntityType;
|
|
28
|
+
capability: Capability;
|
|
29
|
+
permissions: Permission[];
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Response from checking a Capability
|
|
33
|
+
*/
|
|
34
|
+
export interface ICapabilityAccessResponse extends IAccessResponse {
|
|
35
|
+
/**
|
|
36
|
+
* Capability being checked
|
|
37
|
+
*/
|
|
38
|
+
capability: Capability;
|
|
39
|
+
/**
|
|
40
|
+
* Individual permission check responses. Used for observability
|
|
41
|
+
*/
|
|
42
|
+
responses: IPermissionAccessResponse[];
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* All capability checks for an Entity's workspace
|
|
46
|
+
*/
|
|
47
|
+
export interface IWorkspaceCapabilityResponse {
|
|
48
|
+
/**
|
|
49
|
+
* Array of capabilities the current user has access to, in the context of a given entity
|
|
50
|
+
*/
|
|
51
|
+
granted: Capability[];
|
|
52
|
+
/**
|
|
53
|
+
* Detailed checks for each capability. Used for observability
|
|
54
|
+
*/
|
|
55
|
+
details: ICapabilityAccessResponse[];
|
|
56
|
+
}
|
|
57
|
+
export {};
|
|
@@ -84,7 +84,7 @@ export declare const setContentBoundary: (content: IHubContent, boundary: Geogra
|
|
|
84
84
|
itemControl: string;
|
|
85
85
|
access?: import("../core").AccessLevel;
|
|
86
86
|
url?: string;
|
|
87
|
-
|
|
87
|
+
capabilities?: import("..").EntityCapabilities;
|
|
88
88
|
description?: string;
|
|
89
89
|
name: string;
|
|
90
90
|
tags: string[];
|
|
@@ -94,6 +94,7 @@ export declare const setContentBoundary: (content: IHubContent, boundary: Geogra
|
|
|
94
94
|
thumbnailUrl?: string;
|
|
95
95
|
thumbnail?: string;
|
|
96
96
|
typeKeywords?: string[];
|
|
97
|
+
canEdit: boolean;
|
|
97
98
|
canDelete: boolean;
|
|
98
99
|
createdDate: Date;
|
|
99
100
|
createdDateSource: string;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { IGroup } from "@esri/arcgis-rest-portal";
|
|
2
2
|
import { IArcGISContext } from "../ArcGISContext";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { Capability, ICapabilityAccessResponse } from "../capabilities";
|
|
4
|
+
import { IPermissionAccessResponse, IEntityPermissionPolicy, Permission } from "../permissions";
|
|
5
|
+
import { IWithSharingBehavior, IWithStoreBehavior, IWithFeaturedImageBehavior, IWithPermissionBehavior, IWithCapabilityBehavior } from "./behaviors";
|
|
5
6
|
import { IWithThumbnailBehavior } from "./behaviors/IWithThumbnailBehavior";
|
|
6
7
|
import { IHubItemEntity, SettableAccessLevel } from "./types";
|
|
7
8
|
/**
|
|
8
9
|
* Base class for all Hub Entities backed by items
|
|
9
10
|
*/
|
|
10
|
-
export declare abstract class HubItemEntity<T extends IHubItemEntity> implements IWithStoreBehavior<T>, IWithSharingBehavior, IWithThumbnailBehavior, IWithFeaturedImageBehavior, IWithPermissionBehavior {
|
|
11
|
+
export declare abstract class HubItemEntity<T extends IHubItemEntity> implements IWithStoreBehavior<T>, IWithSharingBehavior, IWithThumbnailBehavior, IWithFeaturedImageBehavior, IWithPermissionBehavior, IWithCapabilityBehavior {
|
|
11
12
|
protected context: IArcGISContext;
|
|
12
13
|
protected entity: T;
|
|
13
14
|
protected isDestroyed: boolean;
|
|
@@ -22,7 +23,7 @@ export declare abstract class HubItemEntity<T extends IHubItemEntity> implements
|
|
|
22
23
|
* @param permission
|
|
23
24
|
* @returns
|
|
24
25
|
*/
|
|
25
|
-
checkPermission(permission: Permission):
|
|
26
|
+
checkPermission(permission: Permission): IPermissionAccessResponse;
|
|
26
27
|
/**
|
|
27
28
|
* Get all policies related to a specific permission
|
|
28
29
|
* @param permission
|
|
@@ -40,6 +41,11 @@ export declare abstract class HubItemEntity<T extends IHubItemEntity> implements
|
|
|
40
41
|
* @param id
|
|
41
42
|
*/
|
|
42
43
|
removePermissionPolicy(permission: Permission, id: string): void;
|
|
44
|
+
/**
|
|
45
|
+
* Check if the current user can access a specific capability
|
|
46
|
+
* @param capability
|
|
47
|
+
*/
|
|
48
|
+
checkCapability(capability: Capability): ICapabilityAccessResponse;
|
|
43
49
|
/**
|
|
44
50
|
* Return the entity id
|
|
45
51
|
*/
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IPermissionAccessResponse, IEntityPermissionPolicy, Permission } from "../../permissions";
|
|
2
|
+
import { Capability, ICapabilityAccessResponse } from "../../capabilities";
|
|
2
3
|
/**
|
|
3
4
|
* Composable behavior that adds permissions to an entity
|
|
4
5
|
*/
|
|
@@ -8,7 +9,7 @@ export interface IWithPermissionBehavior {
|
|
|
8
9
|
* taking into account any entity specific policies
|
|
9
10
|
* @param permission
|
|
10
11
|
*/
|
|
11
|
-
checkPermission(permission: Permission):
|
|
12
|
+
checkPermission(permission: Permission): IPermissionAccessResponse;
|
|
12
13
|
/**
|
|
13
14
|
* Get all policies for a specific permission
|
|
14
15
|
* @param permission
|
|
@@ -26,3 +27,10 @@ export interface IWithPermissionBehavior {
|
|
|
26
27
|
*/
|
|
27
28
|
removePermissionPolicy(permission: Permission, id: string): void;
|
|
28
29
|
}
|
|
30
|
+
export interface IWithCapabilityBehavior {
|
|
31
|
+
/**
|
|
32
|
+
* Is a specific capability available and enabled for the this entity?
|
|
33
|
+
* @param capability
|
|
34
|
+
*/
|
|
35
|
+
checkCapability(capability: Capability): ICapabilityAccessResponse;
|
|
36
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IEntityPermissionPolicy } from "../../permissions";
|
|
2
|
+
import { EntityCapabilities } from "../../capabilities";
|
|
2
3
|
/**
|
|
3
4
|
* Adds permissions property to an entity
|
|
4
5
|
*/
|
|
@@ -7,4 +8,5 @@ export interface IWithPermissions {
|
|
|
7
8
|
* Array of permission policies that apply to the entity
|
|
8
9
|
*/
|
|
9
10
|
permissions?: IEntityPermissionPolicy[];
|
|
11
|
+
capabilities?: EntityCapabilities;
|
|
10
12
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { PolicyResponse } from "../../permissions/types/PolicyResponse";
|
|
2
|
+
export interface IAccessResponse {
|
|
3
|
+
/**
|
|
4
|
+
* Is the user allowed to perform the action
|
|
5
|
+
*/
|
|
6
|
+
access: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Code for the access response. Used for i18n and UX level messages
|
|
9
|
+
*/
|
|
10
|
+
code: string;
|
|
11
|
+
/**
|
|
12
|
+
* Reason for the access response
|
|
13
|
+
*/
|
|
14
|
+
response: PolicyResponse;
|
|
15
|
+
/**
|
|
16
|
+
* Message with details access response. Typically used to return additional
|
|
17
|
+
* information about assertion failures
|
|
18
|
+
*/
|
|
19
|
+
message?: string;
|
|
20
|
+
}
|
|
@@ -18,10 +18,6 @@ export interface IHubSite extends IHubItemEntity, IWithSlug, IWithCatalog, IWith
|
|
|
18
18
|
* Site Theme as json
|
|
19
19
|
*/
|
|
20
20
|
theme: Record<string, any>;
|
|
21
|
-
/**
|
|
22
|
-
* Array of capabilities enabled for the site
|
|
23
|
-
*/
|
|
24
|
-
capabilities: string[];
|
|
25
21
|
/**
|
|
26
22
|
* Subdomain of the site
|
|
27
23
|
* Will be prepended to `<org-key>.hub.arcgis.com`
|
|
@@ -64,4 +60,8 @@ export interface IHubSite extends IHubItemEntity, IWithSlug, IWithCatalog, IWith
|
|
|
64
60
|
* Header CSS
|
|
65
61
|
*/
|
|
66
62
|
headerSass: string;
|
|
63
|
+
/**
|
|
64
|
+
* Classic capabilities
|
|
65
|
+
*/
|
|
66
|
+
classicCapabilities: string[];
|
|
67
67
|
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { IHubInitiative, IWithPermissionBehavior, IWithCatalogBehavior, IWithStoreBehavior, IWithSharingBehavior } from "../core";
|
|
1
|
+
import { IHubInitiative, IWithPermissionBehavior, IWithCatalogBehavior, IWithStoreBehavior, IWithSharingBehavior, IWithCapabilityBehavior } from "../core";
|
|
2
2
|
import { Catalog } from "../search/Catalog";
|
|
3
3
|
import { IArcGISContext } from "../ArcGISContext";
|
|
4
4
|
import { HubItemEntity } from "../core/HubItemEntity";
|
|
5
5
|
/**
|
|
6
6
|
* Hub Initiative Class
|
|
7
7
|
*/
|
|
8
|
-
export declare class HubInitiative extends HubItemEntity<IHubInitiative> implements IWithStoreBehavior<IHubInitiative>, IWithPermissionBehavior, IWithCatalogBehavior, IWithSharingBehavior {
|
|
8
|
+
export declare class HubInitiative extends HubItemEntity<IHubInitiative> implements IWithStoreBehavior<IHubInitiative>, IWithPermissionBehavior, IWithCapabilityBehavior, IWithCatalogBehavior, IWithSharingBehavior {
|
|
9
9
|
private _catalog;
|
|
10
10
|
/**
|
|
11
11
|
* Private constructor so we don't have `new` all over the place. Allows for
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { EntityCapabilities, ICapabilityPermission, IPermissionPolicy } from "../../index";
|
|
2
|
+
/**
|
|
3
|
+
* Default capabilities for a Initiative. If not listed here, the capability will not be available
|
|
4
|
+
* This hash is combined with the capabilities hash stored in the item data. Regardless of what
|
|
5
|
+
* properties are defined in the item data, only the capabilities defined here will be available
|
|
6
|
+
* @private
|
|
7
|
+
*/
|
|
8
|
+
export declare const InitiativeDefaultCapabilities: EntityCapabilities;
|
|
9
|
+
/**
|
|
10
|
+
* List of all the Initiative Capability Permissions
|
|
11
|
+
* These are considered Hub Business Rules and are not intended
|
|
12
|
+
* to be modified by consumers
|
|
13
|
+
* @private
|
|
14
|
+
*/
|
|
15
|
+
export declare const InitiativeCapabilityPermissions: ICapabilityPermission[];
|
|
16
|
+
/**
|
|
17
|
+
* Initiative Permission Policies
|
|
18
|
+
* These define the requirements any user must meet to perform related actions
|
|
19
|
+
* @private
|
|
20
|
+
*/
|
|
21
|
+
export declare const InitiativePermissions: readonly ["hub:initiative:create", "hub:initiative:delete", "hub:initiative:edit", "hub:initiative:view"];
|
|
22
|
+
/**
|
|
23
|
+
* Initiative permission policies
|
|
24
|
+
* @private
|
|
25
|
+
*/
|
|
26
|
+
export declare const InitiativePermissionPolicies: IPermissionPolicy[];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IRequestOptions } from "@esri/arcgis-rest-request";
|
|
2
|
+
import { IModel } from "../../types";
|
|
3
|
+
import { IHubInitiative } from "../../core";
|
|
4
|
+
/**
|
|
5
|
+
* Given a model and an Initiative, set various computed properties that can't be directly mapped
|
|
6
|
+
* @private
|
|
7
|
+
* @param model
|
|
8
|
+
* @param initiative
|
|
9
|
+
* @param requestOptions
|
|
10
|
+
* @returns
|
|
11
|
+
*/
|
|
12
|
+
export declare function computeProps(model: IModel, initiative: Partial<IHubInitiative>, requestOptions: IRequestOptions): IHubInitiative;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IPropertyMap } from "../../core/_internal/PropertyMapper";
|
|
2
|
+
/**
|
|
3
|
+
* Returns an Array of IPropertyMap objects
|
|
4
|
+
* that define the projection of properties from a IModel to an IHubProject
|
|
5
|
+
* @returns
|
|
6
|
+
* @private
|
|
7
|
+
*/
|
|
8
|
+
export declare function getPropertyMap(): IPropertyMap[];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IArcGISContext } from "../../ArcGISContext";
|
|
2
|
+
import { IPermissionPolicy, IPolicyCheck } from "../types";
|
|
3
|
+
/**
|
|
4
|
+
* Validate entityOwner policy
|
|
5
|
+
* @param policy
|
|
6
|
+
* @param context
|
|
7
|
+
* @param entity
|
|
8
|
+
* @returns
|
|
9
|
+
*/
|
|
10
|
+
export declare function checkAlphaGating(policy: IPermissionPolicy, context: IArcGISContext, entity?: Record<string, any>): IPolicyCheck[];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IArcGISContext } from "../../ArcGISContext";
|
|
2
|
+
import { IPolicyAssertion, IPolicyCheck } from "../types";
|
|
3
|
+
/**
|
|
4
|
+
* Check a specific EntityAssertion
|
|
5
|
+
* Exported purely for testing. Not exported from the package.
|
|
6
|
+
* @param assertion
|
|
7
|
+
* @param entity
|
|
8
|
+
* @param context
|
|
9
|
+
* @returns
|
|
10
|
+
*/
|
|
11
|
+
export declare function checkAssertion(assertion: IPolicyAssertion, entity: Record<string, any>, context: IArcGISContext): IPolicyCheck;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IArcGISContext } from "../../ArcGISContext";
|
|
2
|
+
import { IPermissionPolicy, IPolicyCheck } from "../types";
|
|
3
|
+
/**
|
|
4
|
+
* Validate entityOwner policy
|
|
5
|
+
* @param policy
|
|
6
|
+
* @param context
|
|
7
|
+
* @param entity
|
|
8
|
+
* @returns
|
|
9
|
+
*/
|
|
10
|
+
export declare function checkAssertions(policy: IPermissionPolicy, context: IArcGISContext, entity?: Record<string, any>): IPolicyCheck[];
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { IArcGISContext } from "../../ArcGISContext";
|
|
2
|
-
import { HubEntity } from "../../core";
|
|
3
2
|
import { IPermissionPolicy, IPolicyCheck } from "../types";
|
|
4
3
|
/**
|
|
5
4
|
* Validate authentication policy
|
|
@@ -8,4 +7,4 @@ import { IPermissionPolicy, IPolicyCheck } from "../types";
|
|
|
8
7
|
* @param entity
|
|
9
8
|
* @returns
|
|
10
9
|
*/
|
|
11
|
-
export declare function checkAuthentication(policy: IPermissionPolicy, context: IArcGISContext, entity?:
|
|
10
|
+
export declare function checkAuthentication(policy: IPermissionPolicy, context: IArcGISContext, entity?: Record<string, any>): IPolicyCheck[];
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { IArcGISContext } from "../../ArcGISContext";
|
|
2
|
-
import { HubEntity } from "../../core";
|
|
3
2
|
import { IPermissionPolicy, IPolicyCheck } from "../types";
|
|
4
3
|
/**
|
|
5
4
|
* Validate entityEdit policy
|
|
@@ -8,4 +7,4 @@ import { IPermissionPolicy, IPolicyCheck } from "../types";
|
|
|
8
7
|
* @param entity
|
|
9
8
|
* @returns
|
|
10
9
|
*/
|
|
11
|
-
export declare function checkEdit(policy: IPermissionPolicy, context: IArcGISContext, entity?:
|
|
10
|
+
export declare function checkEdit(policy: IPermissionPolicy, context: IArcGISContext, entity?: Record<string, any>): IPolicyCheck[];
|
|
@@ -7,4 +7,4 @@ import { IPermissionPolicy, IPolicyCheck } from "../types";
|
|
|
7
7
|
* @param context
|
|
8
8
|
* @returns
|
|
9
9
|
*/
|
|
10
|
-
export declare function checkLicense(policy: IPermissionPolicy, context: IArcGISContext): IPolicyCheck[];
|
|
10
|
+
export declare function checkLicense(policy: IPermissionPolicy, context: IArcGISContext, entity?: Record<string, any>): IPolicyCheck[];
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { IArcGISContext } from "../../ArcGISContext";
|
|
2
|
-
import { HubEntity } from "../../core";
|
|
3
2
|
import { IPermissionPolicy, IPolicyCheck } from "../types";
|
|
4
3
|
/**
|
|
5
4
|
* Validate entityOwner policy
|
|
@@ -8,4 +7,4 @@ import { IPermissionPolicy, IPolicyCheck } from "../types";
|
|
|
8
7
|
* @param entity
|
|
9
8
|
* @returns
|
|
10
9
|
*/
|
|
11
|
-
export declare function checkOwner(policy: IPermissionPolicy, context: IArcGISContext, entity?:
|
|
10
|
+
export declare function checkOwner(policy: IPermissionPolicy, context: IArcGISContext, entity?: Record<string, any>): IPolicyCheck[];
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { IArcGISContext } from "../../ArcGISContext";
|
|
2
|
-
import { HubEntity } from "../../core";
|
|
3
2
|
import { IPermissionPolicy, IPolicyCheck } from "../types";
|
|
4
3
|
/**
|
|
5
4
|
* Validate privilege policy
|
|
@@ -8,4 +7,4 @@ import { IPermissionPolicy, IPolicyCheck } from "../types";
|
|
|
8
7
|
* @param entity
|
|
9
8
|
* @returns
|
|
10
9
|
*/
|
|
11
|
-
export declare function checkPrivileges(policy: IPermissionPolicy, context: IArcGISContext, entity?:
|
|
10
|
+
export declare function checkPrivileges(policy: IPermissionPolicy, context: IArcGISContext, entity?: Record<string, any>): IPolicyCheck[];
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { IArcGISContext } from "../ArcGISContext";
|
|
2
|
-
import {
|
|
3
|
-
import { IAccessResponse, Permission } from "./types";
|
|
2
|
+
import { IPermissionAccessResponse, Permission } from "./types";
|
|
4
3
|
/**
|
|
5
4
|
* Check a permission against the system policies, and possibly an entity policy
|
|
6
5
|
* @param permission
|
|
@@ -8,4 +7,4 @@ import { IAccessResponse, Permission } from "./types";
|
|
|
8
7
|
* @param entity
|
|
9
8
|
* @returns
|
|
10
9
|
*/
|
|
11
|
-
export declare function checkPermission(permission: Permission, context: IArcGISContext, entity?:
|
|
10
|
+
export declare function checkPermission(permission: Permission, context: IArcGISContext, entity?: Record<string, any>): IPermissionAccessResponse;
|
|
@@ -19,4 +19,4 @@ export interface IEntityPermissionPolicy {
|
|
|
19
19
|
/**
|
|
20
20
|
* Type of collaboration set. Used when associating a permission with a set of collaborators
|
|
21
21
|
*/
|
|
22
|
-
export declare type CollaborationType = "user" | "group" | "group-admin" | "org";
|
|
22
|
+
export declare type CollaborationType = "user" | "group" | "group-admin" | "org" | "authenticated" | "anonymous";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Permission } from "./Permission";
|
|
2
|
+
import { Capability } from "../../capabilities";
|
|
3
|
+
import { IAccessResponse } from "../../core/types/IAccessResponse";
|
|
4
|
+
import { IPolicyCheck } from "./IPolicyCheck";
|
|
5
|
+
/**
|
|
6
|
+
* Response from a permission check
|
|
7
|
+
*/
|
|
8
|
+
export interface IPermissionAccessResponse extends IAccessResponse {
|
|
9
|
+
/**
|
|
10
|
+
* Permission being checked
|
|
11
|
+
*/
|
|
12
|
+
policy: Permission | Capability;
|
|
13
|
+
/**
|
|
14
|
+
* List of all the policies that were checked, and their responses
|
|
15
|
+
* For debugging / observability
|
|
16
|
+
*/
|
|
17
|
+
checks: IPolicyCheck[];
|
|
18
|
+
}
|
|
@@ -20,29 +20,38 @@ export interface IPermissionPolicy {
|
|
|
20
20
|
/**
|
|
21
21
|
* Must the user authenticated?
|
|
22
22
|
*/
|
|
23
|
-
authenticated
|
|
23
|
+
authenticated?: boolean;
|
|
24
24
|
/**
|
|
25
25
|
* What licenses are required for this permission to be granted.
|
|
26
26
|
* This is checking the licese of the current user's org. It is not transitive to the entity being accessed.
|
|
27
27
|
* e.g. If a user is in a Partner "hub-basic" org, they can not create "premium" entities (e.g. Projects)
|
|
28
28
|
*/
|
|
29
|
-
licenses
|
|
29
|
+
licenses?: HubLicense[];
|
|
30
30
|
/**
|
|
31
31
|
* Any platform level privileges required for this permission to be granted
|
|
32
32
|
* e.g. "portal:user:createItem"
|
|
33
33
|
*/
|
|
34
34
|
privileges?: PlatformPrivilege[];
|
|
35
35
|
/**
|
|
36
|
-
*
|
|
37
|
-
* This is likely extremely rare.
|
|
38
|
-
*/
|
|
39
|
-
roles?: string[];
|
|
40
|
-
/**
|
|
41
|
-
* Does the user require edit access to the entity to be granted this permission?
|
|
36
|
+
* Is the user an owner of the entity being accessed?
|
|
42
37
|
*/
|
|
43
38
|
entityEdit?: boolean;
|
|
44
39
|
/**
|
|
45
|
-
*
|
|
40
|
+
* Must the user be the owner of the entity being accessed?
|
|
46
41
|
*/
|
|
47
42
|
entityOwner?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Is this gated to alpha orgs?
|
|
45
|
+
*/
|
|
46
|
+
alpha?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* More complex policies can be defined with a set of assertions
|
|
49
|
+
*/
|
|
50
|
+
assertions?: IPolicyAssertion[];
|
|
51
|
+
}
|
|
52
|
+
export interface IPolicyAssertion {
|
|
53
|
+
property: string;
|
|
54
|
+
type: AssertionType;
|
|
55
|
+
value: any;
|
|
48
56
|
}
|
|
57
|
+
export declare type AssertionType = "eq" | "neq" | "gt" | "lt" | "contains" | "contains-all" | "without" | "included-in" | "is-group-admin" | "is-group-member" | "is-group-owner";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Defines the values for Permissions
|
|
3
|
-
*
|
|
4
|
-
*
|
|
3
|
+
* It's critical that the arrays defined in the modules use `as const`
|
|
4
|
+
* otherwise Permission devolves into just a string type
|
|
5
5
|
*/
|
|
6
|
-
declare const validPermissions: readonly ["hub:site:create", "hub:site:delete", "hub:site:edit", "hub:site:view", "hub:project:create", "hub:project:delete", "hub:project:edit", "hub:project:view"];
|
|
6
|
+
declare const validPermissions: readonly ["hub:site:create", "hub:site:delete", "hub:site:edit", "hub:site:view", "hub:project:create", "hub:project:delete", "hub:project:edit", "hub:project:view", "hub:initiative:create", "hub:initiative:delete", "hub:initiative:edit", "hub:initiative:view"];
|
|
7
7
|
/**
|
|
8
8
|
* Defines the possible values for Permissions
|
|
9
9
|
*/
|
|
@@ -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" | "invalid-permission" | "privilege-required" | "system-offline" | "system-maintenance" | "entity-required" | "not-authenticated";
|
|
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";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IHubProject, IWithPermissionBehavior, IWithCatalogBehavior, IWithStoreBehavior, IWithSharingBehavior, UiSchemaElementOptions } from "../core";
|
|
1
|
+
import { IHubProject, IWithPermissionBehavior, IWithCatalogBehavior, IWithStoreBehavior, IWithSharingBehavior, UiSchemaElementOptions, IWithCapabilityBehavior } from "../core";
|
|
2
2
|
import { Catalog } from "../search/Catalog";
|
|
3
3
|
import { IArcGISContext } from "../ArcGISContext";
|
|
4
4
|
import { HubItemEntity } from "../core/HubItemEntity";
|
|
@@ -6,7 +6,7 @@ import { EditorConfigType, IEditorConfig } from "../core/behaviors/IWithEditorBe
|
|
|
6
6
|
/**
|
|
7
7
|
* Hub Project Class
|
|
8
8
|
*/
|
|
9
|
-
export declare class HubProject extends HubItemEntity<IHubProject> implements IWithStoreBehavior<IHubProject>, IWithPermissionBehavior, IWithCatalogBehavior, IWithSharingBehavior {
|
|
9
|
+
export declare class HubProject extends HubItemEntity<IHubProject> implements IWithStoreBehavior<IHubProject>, IWithPermissionBehavior, IWithCapabilityBehavior, IWithCatalogBehavior, IWithSharingBehavior {
|
|
10
10
|
private _catalog;
|
|
11
11
|
/**
|
|
12
12
|
* Private constructor so we don't have `new` all over the place. Allows for
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { EntityCapabilities, ICapabilityPermission, IPermissionPolicy } from "../../index";
|
|
2
|
+
/**
|
|
3
|
+
* Default capabilities for a Project. If not listed here, the capability will not be available
|
|
4
|
+
* This hash is combined with the capabilities hash stored in the item data. Regardless of what
|
|
5
|
+
* properties are defined in the item data, only the capabilities defined here will be available
|
|
6
|
+
* @private
|
|
7
|
+
*/
|
|
8
|
+
export declare const ProjectDefaultCapabilities: EntityCapabilities;
|
|
9
|
+
/**
|
|
10
|
+
* List of all the Project Capability Permissions
|
|
11
|
+
* These are considered Hub Business Rules and are not intended
|
|
12
|
+
* to be modified by consumers
|
|
13
|
+
* @private
|
|
14
|
+
*/
|
|
15
|
+
export declare const ProjectCapabilityPermissions: ICapabilityPermission[];
|
|
16
|
+
/**
|
|
17
|
+
* Project Permission Policies
|
|
18
|
+
* These define the requirements any user must meet to perform related actions
|
|
19
|
+
* @private
|
|
20
|
+
*/
|
|
21
|
+
export declare const ProjectPermissions: readonly ["hub:project:create", "hub:project:delete", "hub:project:edit", "hub:project:view"];
|
|
22
|
+
/**
|
|
23
|
+
* Project permission policies
|
|
24
|
+
* @private
|
|
25
|
+
*/
|
|
26
|
+
export declare const ProjectPermissionPolicies: IPermissionPolicy[];
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { IRequestOptions } from "@esri/arcgis-rest-request";
|
|
2
|
-
import { IHubProject } from "
|
|
3
|
-
import {
|
|
4
|
-
import { IModel } from "../types";
|
|
2
|
+
import { IHubProject } from "../../core";
|
|
3
|
+
import { IModel } from "../../types";
|
|
5
4
|
/**
|
|
6
5
|
* Given a model and a project, set various computed properties that can't be directly mapped
|
|
7
6
|
* @private
|
|
@@ -11,10 +10,3 @@ import { IModel } from "../types";
|
|
|
11
10
|
* @returns
|
|
12
11
|
*/
|
|
13
12
|
export declare function computeProps(model: IModel, project: Partial<IHubProject>, requestOptions: IRequestOptions): IHubProject;
|
|
14
|
-
/**
|
|
15
|
-
* Returns an Array of IPropertyMap objects
|
|
16
|
-
* that define the projection of properties from a IModel to an IHubProject
|
|
17
|
-
* @returns
|
|
18
|
-
* @private
|
|
19
|
-
*/
|
|
20
|
-
export declare function getPropertyMap(): IPropertyMap[];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IPropertyMap } from "../../core/_internal/PropertyMapper";
|
|
2
|
+
/**
|
|
3
|
+
* Returns an Array of IPropertyMap objects
|
|
4
|
+
* that define the projection of properties from a IModel to an IHubProject
|
|
5
|
+
* @returns
|
|
6
|
+
* @private
|
|
7
|
+
*/
|
|
8
|
+
export declare function getPropertyMap(): IPropertyMap[];
|
|
@@ -57,7 +57,7 @@ export declare function fetchSite(identifier: string, requestOptions: IHubReques
|
|
|
57
57
|
* @param requestOptions
|
|
58
58
|
* @returns
|
|
59
59
|
*/
|
|
60
|
-
export declare function convertModelToSite(model: IModel, requestOptions:
|
|
60
|
+
export declare function convertModelToSite(model: IModel, requestOptions: IRequestOptions): IHubSite;
|
|
61
61
|
/**
|
|
62
62
|
* Convert a Hub Site Application item into a Hub Site, fetching any
|
|
63
63
|
* additional information that may be required
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { EntityCapabilities, ICapabilityPermission } from "../../index";
|
|
2
|
+
import { IPermissionPolicy } from "../../permissions/types";
|
|
3
|
+
/**
|
|
4
|
+
* Default capabilities for a Site. If not listed here, the capability will not be available
|
|
5
|
+
* This hash is combined with the capabilities hash stored in the item data. Regardless of what
|
|
6
|
+
* properties are defined in the item data, only the capabilities defined here will be available
|
|
7
|
+
* @private
|
|
8
|
+
*/
|
|
9
|
+
export declare const SiteDefaultCapabilities: EntityCapabilities;
|
|
10
|
+
/**
|
|
11
|
+
* List of all the Site Capability Permissions
|
|
12
|
+
* These are considered Hub Business Rules and are not intended
|
|
13
|
+
* to be modified by consumers
|
|
14
|
+
*/
|
|
15
|
+
export declare const SiteCapabilityPermissions: ICapabilityPermission[];
|
|
16
|
+
/**
|
|
17
|
+
* Site Permissions
|
|
18
|
+
* This feeds into the Permissions type
|
|
19
|
+
*/
|
|
20
|
+
export declare const SitePermissions: readonly ["hub:site:create", "hub:site:delete", "hub:site:edit", "hub:site:view"];
|
|
21
|
+
/**
|
|
22
|
+
* Site permission policies
|
|
23
|
+
* @private
|
|
24
|
+
*/
|
|
25
|
+
export declare const SitesPermissionPolicies: IPermissionPolicy[];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IRequestOptions } from "@esri/arcgis-rest-request";
|
|
2
|
+
import { IHubSite } from "../../core";
|
|
3
|
+
import { IModel } from "../../types";
|
|
4
|
+
/**
|
|
5
|
+
* Given a model and a site, set various computed properties that can't be directly mapped
|
|
6
|
+
* @private
|
|
7
|
+
* @param model
|
|
8
|
+
* @param site
|
|
9
|
+
* @param requestOptions
|
|
10
|
+
* @returns
|
|
11
|
+
*/
|
|
12
|
+
export declare function computeProps(model: IModel, site: Partial<IHubSite>, requestOptions: IRequestOptions): IHubSite;
|