Skip To Content ArcGIS for Developers Sign In Dashboard

PortalPrivilegeListModel QML Type

Represents the set of privileges possessed by a portal user. More...

Import Statement: import Esri.ArcGISRuntime 100.6
Since: Esri.ArcGISRuntime 100.0

Properties

Signals

Methods

  • bool contains(PortalPrivilege portalPrivilege)
  • void forEach(callback )
  • PortalPrivilege get(int index)
  • int indexOf(PortalPrivilege portalPrivilege)

Detailed Description

This type is returned by calling privileges on a PortalUser object. Each privilege permits the user to peform specific operations on the portal.

The model returns data for the following roles:

RoleTypeDescription
portalPrivilegeRealmEnums.PortalPrivilegeRealmThe realm the privilege belongs to.
portalPrivilegeRoleEnums.PortalPrivilegeRoleThe role the privilege applies to.
portalPrivilegeTypeEnums.PortalPrivilegeTypeThe operation permitted by the privilege.

Example:

Accessing various roles of the model from within a QML delegate:

Text{
    anchors.fill: parent
    // acccess the portalPrivilegeRealm, portalPrivilegeRole and portalPrivilegeType roles of the model
    text: "realm:" + portalPrivilegeRealm + "; role:" + portalPrivilegeRole + "; type:" + portalPrivilegeType
    wrapMode: Text.WrapAnywhere
}

See also Portal and PortalPrivilege.

Property Documentation

count : int

Returns the number of objects in the model (read-only).


error : Error

Returns the error (if any) that occurred (read-only).


Signal Documentation

countChanged()

Emitted when the count property of the model changes.


errorChanged()

Signal emitted when the error property changes, which can indicate that an error occurred.


portalPrivilegeAdded(int index)

Signal emitted when a privilege is added to the model. index The index at which the PortalPrivilege was added.


portalPrivilegeRemoved(int index)

Signal emitted when an item is privilege from the model. index The index at which the PortalPrivilege was removed.


Method Documentation

bool contains(PortalPrivilege portalPrivilege)

Whether the list model contains the specified portalPrivilege.


void forEach(callback )

Receives a callback function to execute for each privilege in the model.

The callback function can take 0 to 3 optional arguments, in order:

Returns undefined if no error occurred, and an error message otherwise.

var error = PortalPrivilegeListModel.forEach(function(element, index, array) {
    ...
});
if (error) {
    console.error(error.message);
}

PortalPrivilege get(int index) const

Returns the PortalPrivilege at the specified index.


int indexOf(PortalPrivilege portalPrivilege)

Returns the index of a specific portal privilege (portalPrivilege) from the list model.

This QML method was introduced in Esri::ArcGISRuntime 100.5..



Feedback on this topic?