dojo.require("esri.arcgis.PortalUser")
Description
(Added at v2.8)
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. A user is not visible to any other users (except their organization's administrator) if their access setting is set to 'private'. View the ArcGIS Portal API REST documentation for the
user for more details.
Samples
Search for
samples that use this class.
Properties
Methods
Property Details
The access level for the user: private, org or public. If private, the users descriptive information will not be available and the user name will not be searchable. Available only if the user is signed-in.
Known values: private | org | public
The date the user was created.
The default culture for the user.
The user's email address. Available only if the user is signed-in.
The date the user was modified.
The id of the organization the user belongs to.
The user's preferred view for content, either Web or GIS. Available only if the user is signed-in.
The user's preferred region, used to set the featured maps on the portal home page, content in the gallery and the default extent for new maps in the Viewer.
The user's role in the organization: administrator (org_admin), publisher (org_publisher), or user (org_user).
User-defined tags that describe the user.
The url to the thumbnail image for the user.
The URL for the user content. (Added at v3.2)
The username for the user.
Method Details
Find folders for the portal user. Returns a deferred that when resolved provides access to an array of
PortalFolder objects.
Sample:
portalUser.getFolders().then(function(folders){
dojo.forEach(folders,function(folder){
if(folder.title === 'javascript'){
folderid = folder.id;
}
});
});
Provides access to the group invitations for the portal user. Returns a deferred that when resolved provides access to the results as json. View the
REST API documentation for details on the result format.
Find all the groups that the portal user has permissions to access. Returns a deferred that when resolved provides access to an array of
PortalGroup objects.
Sample:
portalUser.getGroups().then(function(groups){
dojo.forEach(groups,function(group){
var description = group.description;
});
});
Get the portal item along with folder info for the input item id. (Added at v3.4)
Parameters:
<String > itemId |
Required |
The id of the item. |
Sample:
loggedInUser.getItem("1084880a33cc4669a1afe8c298d46871").then(function(results){
//do something with the info here.
});
Retrieve all the items in the specified folder. Returns a deferred that when resolved provides access to an array of
PortalItem objects.
Parameters:
<String > folderId |
Optional |
The id of the folder that contains the items to retrieve. |
Sample:
function loadItems(id){
portalUser.getItems(id).then(function(items){
dojo.forEach(items,function(item){
console.log(item);
});
});
}
Get information about any notifications for the portal user. Returns a deferred that when resolved provides access to the results as json. View the
REST API documentation for details on the result format.
Sample:
portalUser.getNotifications().then(function(notifications){
var notificationTarget = notifications[0].target;
});
Access the tag objects that have been created by the portal user. Returns a deferred that when resolved provides access to an array of tag objects used by the user. Each tag object contains a tag
property with the name of the tag along with a count
that reports the number of times the tag was used.
Sample:
portalUser.getTags().then(function(tagItems){
dojo.forEach(tagItems,function(tagItem){
console.log(tagItem.tag);
});
});
Get the URL to the thumbnail image for the portal user.
Available width sizes: 150, 300 and 600. (Added at v3.21)
Parameters:
<Number > width |
Optional |
The desired image width. |