ArcGISContext
Abstraction that holds a UserSession
, along with
getters to streamline access to various platform
urls, and common constructs like IRequestOptions
,
IUserRequestOptions
etc.
Instances are intended to be immutable, but this is not directly enforced.
In most circumstances, this class should be created by the ArcGISContextManager class.
Implements
Constructors
Constructor Parameters
Parameter | Type | Default | Notes |
---|---|---|---|
opts Required | IArcGISContextOptions |
Properties
Accessors
Accessor | Type | Notes |
---|---|---|
string |
Returns the Hub Community Org Hostname, if defined |
|
string |
Return the Hub Community Org Id, if defined |
|
string |
Returns the Hub Community Org url |
|
IUser |
Returns the current user as IUser |
|
string |
Returns the discussions API URL |
|
string |
Returns Hub Domain Service URL |
|
string |
If we are in a community org with an associated e-org Return the Hub Enterprise Org Id, if defined |
|
HubEnvironment |
Return the HubEnvironment of the current context |
|
any |
Returns the Events configuration object from portal/self |
|
IFeatureFlags |
Return hash of feature flags passed into constructor. Default is empty object. |
|
any |
Returns the hash of helper services from portal self |
|
IHubHistory |
Return the user's history |
|
boolean |
Returns boolean indicating if the current user belongs to an organization that has licensed ArcGIS Hub |
|
string |
Returns the current user's hub-home url. If not authenticated, returns the Hub Url. If portal, returns undefined |
|
HubLicense |
Returns the current user's Hub License |
|
IHubRequestOptions |
Return a |
|
string |
Returns the Hub Search API URL |
|
string |
Returns the Hub url, based on the portalUrl |
|
boolean |
Is the users org in the alpha orgs list? Alpha orgs are passed in via properties.alphaOrgs |
|
boolean |
Return boolean indicating if authenticatio is present |
|
boolean |
Is the users org in the beta orgs list? Beta orgs are passed in via properties.betaOrgs |
|
boolean |
Returns whether the current user's org type is a community org |
|
boolean |
Returns whether the current user is an org admin and not in a custom role. |
|
boolean |
Returns boolean indicating if the backing system is ArcGIS Enterprise (formerly ArcGIS Portal) or not |
|
string |
Returns Hub OGCAPI Service URL |
|
string | ||
IPortal |
Returns the portal object as IPortal |
|
string |
Return the portal url i.e. https://www.arcgis.com |
|
Record<stringany> |
Return the properties hash that was passed in. Useful for app-specific context such as the active Site for ArcGIS Hub |
|
IRequestOptions |
Return |
|
string[] |
Return an array of GroupIds, per-environment, that contain Hub Resources (linkable documents etc) that are tagged to appear in different areas of the appliation. |
|
HubServiceStatus |
Returns the current hub service status information |
|
UserSession |
Return the UserSession if authenticated |
|
string |
Returns the url to the sharing api composed from portalUrl i.e. https://myorg.maps.arcgis.com/sharing/rest |
|
string |
Return the survey123 url |
|
string[] |
Returns the array of Trusted Org Ids |
|
IHubTrustedOrgsResponse[] |
Returns the array of Trusted Orgs |
|
IUserHubSettings |
Return the user hub settings.
Updates must be done via |
|
IUserRequestOptions |
Return |
|
IUserResourceToken[] |
Return the whole array of user resource tokens |
Methods
Method | Returns | Notes |
---|---|---|
|
Promise<void> |
Add an entry to the user's history |
|
IPermissionAccessResponse |
Check specific permission for the current user, and optionally an entity |
|
Promise<void> |
Clear the entire history |
|
Promise<void> |
Re-fetch the current user, including their groups |
|
Promise<void> |
Remove a specific entry from the user's history |
|
string |
Return a token for a specific app |
|
Promise<void> |
Update the user's hub settings Possible issue here is that we're not updating the contextManager so the contextManager will be out of sync with this instance of ArcGISContext. Unclear if this will be an actual problem. |
addToHistory
Parameters
Parameter | Type | Default | Notes |
---|---|---|---|
entry Required | IHubHistoryEntry |
Returns
checkPermission
Check specific permission for the current user, and optionally an entity
Parameters
Parameter | Type | Default | Notes |
---|---|---|---|
permission Required | Permission | ||
entity Optional | HubEntity |
Returns
removeFromHistory
Remove a specific entry from the user's history
Parameters
Parameter | Type | Default | Notes |
---|---|---|---|
entry Required | IHubHistoryEntry |
Returns
tokenFor
Return a token for a specific app
Parameters
Parameter | Type | Default | Notes |
---|---|---|---|
app Required | UserResourceApp |
Returns
updateUserHubSettings
Update the user's hub settings
Parameters
Parameter | Type | Default | Notes |
---|---|---|---|
settings Required | IUserHubSettings |
Returns
Possible issue here is that we're not updating the contextManager so the contextManager will be out of sync with this instance of ArcGISContext. Unclear if this will be an actual problem.
Class defined in common/src/ArcGISContext.ts:424
Add an entry to the user's history