PortalUser

Class: esri/portal/PortalUser
Inheritance: PortalUser Accessor
Since: ArcGIS API for JavaScript 4.0

Represents a registered user of the Portal. Personal details of the user, such as email and groups, are returned only to the user or the administrator of the user's organization. View the ArcGIS Portal API REST documentation for the user for more details.

See also:

Property Overview

Any properties can be set, retrieved or listened to. See the Working with Properties topic.
NameTypeSummaryClass
String

Indicates the level of access of the user.

more details
more detailsPortalUser
Date

The date the user was created.

more details
more detailsPortalUser
String

The culture information for the user.

more details
more detailsPortalUser
String

The name of the class.

more details
more detailsAccessor
String

A description of the user.

more details
more detailsPortalUser
String

The user's e-mail address.

more details
more detailsPortalUser
String

The user's full name.

more details
more detailsPortalUser
Date

The date the user was last modified.

more details
more detailsPortalUser
String

The ID of the organization the user belongs to.

more details
more detailsPortalUser
Portal

The portal associated with the user.

more details
more detailsPortalUser
String

The user's preferred view for content, either web or GIS.

more details
more detailsPortalUser
String

The user preferred region, used to set the featured maps on the home page, content in the gallery, and the default extent of new maps in the Viewer.

more details
more detailsPortalUser
String

Defines the user's role in the organization.

more details
more detailsPortalUser
String

The ID of the user's role.

more details
more detailsPortalUser
String

The URL to the thumbnail image for the user.

more details
more detailsPortalUser
String

The user's personal units of measure setting.

more details
more detailsPortalUser
String

The URL for the user's content.

more details
more detailsPortalUser
String

The username of the user.

more details
more detailsPortalUser

Property Details

accessString

Indicates the level of access of the user. If private, the user descriptive information will not be available to others nor will the username be searchable.

Possible Values: private | org | public

createdDate

The date the user was created.

cultureString

The culture information for the user.

declaredClassStringreadonly inherited
Since: ArcGIS API for JavaScript 4.7

The name of the class. The declared class name is formatted as esri.folder.className.

descriptionString

A description of the user.

emailString

The user's e-mail address.

fullNameString

The user's full name.

modifiedDate

The date the user was last modified.

orgIdString

The ID of the organization the user belongs to.

portalPortal

The portal associated with the user.

preferredViewString

The user's preferred view for content, either web or GIS.

regionString

The user preferred region, used to set the featured maps on the home page, content in the gallery, and the default extent of new maps in the Viewer.

roleString

Defines the user's role in the organization. See roleId for more details about when user has a custom role.

Possible Values: org_admin | org_publisher | org_user

roleIdString

The ID of the user's role. Only set if the user is assigned a custom role.

When present, the role will indicate the "base" role of the custom role based on the privileges the custom role contains. For example, if the custom role contains some publisher privileges, the role will be set to org_publisher.

thumbnailUrlStringreadonly

The URL to the thumbnail image for the user.

See also:
unitsString

The user's personal units of measure setting.

Possible Values: english | metric

userContentUrlStringreadonly

The URL for the user's content.

usernameString

The username of the user.

Method Overview

NameReturn TypeSummaryClass
Promise<PortalItem>

Adds an item to the user's portal content.

more details
more detailsPortalUser
Promise

Deletes an item from the user's portal content.

more details
more detailsPortalUser
Promise

Deletes items from the user's portal content.

more details
more detailsPortalUser
Promise<PortalFolder[]>

Fetches all of the user's folders used to organize portal content.

more details
more detailsPortalUser
Promise<PortalGroup[]>

Fetches all the groups that the portal user has permission to access.

more details
more detailsPortalUser
Promise<Object>

Retrieves all the items in the specified folder.

more details
more detailsPortalUser
String

Get the URL to the thumbnail image for the user.

more details
more detailsPortalUser
Promise<PortalQueryResult>

Executes a query against the user's favorite group to return an array of PortalItem objects that match the input query.

more details
more detailsPortalUser

Method Details

addItem(params){Promise<PortalItem>}

Adds an item to the user's portal content.

Parameters:
params Object

See the object specifications table below for the parameters that may be passed as properties in this object.

Specification:

The item to add to the user's content.

optional

The component used to stream the data represented by the item to the client.

optional

The portal folder in which to store the item.

Returns:
TypeDescription
Promise<PortalItem>When resolved, returns the PortalItem to be added to the user's content.
deleteItem(item){Promise}

Deletes an item from the user's portal content.

Parameter:

The portal item to remove.

Returns:
TypeDescription
PromiseResolves when the item has been deleted from the user's content.
deleteItems(items){Promise}
Since: ArcGIS API for JavaScript 4.8

Deletes items from the user's portal content.

Parameter:

The portal items to remove.

Returns:
TypeDescription
PromiseResolves when the items have been deleted from the user's content.
fetchFolders(){Promise<PortalFolder[]>}

Fetches all of the user's folders used to organize portal content.

Returns:
TypeDescription
Promise<PortalFolder[]>Resolves to an array of PortalFolder objects representing each of the user's folders in the portal.
Example:
// Once portal is loaded, user signed in
portal.load().then(function() {
  portalUser.fetchFolders().then(function(folders){
    folders.forEach(function(folder){
      console.log(" user folder", folder.title);
    });
  });
});
fetchGroups(){Promise<PortalGroup[]>}

Fetches all the groups that the portal user has permission to access.

Returns:
TypeDescription
Promise<PortalGroup[]>Resolves to an array of PortalGroup objects representing each group that the user can access.
Example:
// Once portal is loaded, user signed in
portal.load().then(function() {
  // fetch all the groups user can access
  portal.user.fetchGroups().then(function(fetchItemResult){
    console.log("user's groups: ", fetchItemResult);
  });
});
fetchItems(params){Promise<Object>}

Retrieves all the items in the specified folder.

Parameters:
params Object
optional

See the object specifications table below for the parameters that may be passed as properties in this object.

Specification:
optional

The folder to retrieve items from.

num Number
optional
Default Value: 10

The maximum number of results to be included in the result set response. The maximum value allowed is 100. The start property combined with the num property can be used to paginate the search results.

start Number
optional
Default Value: 1

The index of the first entry in the result set response. The index is 1-based.

Returns:
TypeDescription
Promise<Object>Resolves to an object with the following properties:
PropertyTypeDescription
itemsPortalItem[]An array containing user's portal items.
nextStartnumberThe next entry index if the current result set doesn't contain all results.
totalnumberThe total number of results.
Example:
// portalUser.fetchItems
portal.user.fetchItems().then(function(fetchItemResult){
   console.log("next start index: ", fetchItemResult.nextStart);
   fetchItemResult.items.forEach(function(item){
     console.log("portal item title:", item.title);
   });
});
getThumbnailUrl(width){String}
Since: ArcGIS API for JavaScript 4.4

Get the URL to the thumbnail image for the user.

Available width sizes: 150, 300 and 600.

Parameter:
width Number
optional

The desired image width.

Returns:
TypeDescription
StringThe URL to the thumbnail image.
queryFavorites(queryParams){Promise<PortalQueryResult>}

Executes a query against the user's favorite group to return an array of PortalItem objects that match the input query.

Parameter:
queryParams PortalQueryParams
optional

The input query parameters defined in PortalQueryParams. This object may be autocast.

Returns:
TypeDescription
Promise<PortalQueryResult>When resolved, resolves to an instance of PortalQueryResult which contains a results array of PortalItem objects representing all the items that match the input query.

API Reference search results

NameTypeModule
Loading...