Represents the set of privileges possessed by a portal user. More...
Import Statement: | import Esri.ArcGISRuntime 100.15 |
Since: | Esri.ArcGISRuntime 100.0 |
Properties
Signals
- countChanged()
- errorChanged()
- itemAdded(int index)
- itemRemoved(int index)
Methods
- bool contains(PortalPrivilege portalPrivilege)
- error 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:
Role | Type | Description |
---|---|---|
portalPrivilegeRealm | Enums.PortalPrivilegeRealm | The realm the privilege belongs to. |
portalPrivilegeRole | Enums.PortalPrivilegeRole | The role the privilege applies to. |
portalPrivilegeType | Enums.PortalPrivilegeType | The operation permitted by the privilege. |
portalPrivilegeSubtype | Enums.PortalPrivilegeSubtype | The fine-grained 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, portalPrivilegeType // and portalPrivilegeSubtype roles of the model text: "realm:" + portalPrivilegeRealm + "; role:" + portalPrivilegeRole + "; type:" + portalPrivilegeType + "; subtype:" + portalPrivilegeSubtype wrapMode: Text.WrapAnywhere }
See also Portal and PortalPrivilege.
Property Documentation
error : Error |
Returns the error (if any) that occurred (read-only).
Signal Documentation
Emitted when the count
property of the model changes.
Note: The corresponding handler is onCountChanged
.
Signal emitted when the error
property changes, which can indicate that an error occurred.
Note: The corresponding handler is onErrorChanged
.
Signal emitted when an item is added to the model. index The index at which the item was added.
Note: The corresponding handler is onItemAdded
.
This signal was introduced in Esri.ArcGISRuntime 100.15.
Signal emitted when an item is removed from the model. index The index at which the item was removed.
Note: The corresponding handler is onItemRemoved
.
This signal was introduced in Esri.ArcGISRuntime 100.15.
Method Documentation
bool contains(PortalPrivilege portalPrivilege) |
Returns true
if the list model contains the specified portalPrivilege.
Receives a callback function to execute for each privilege in the model.
The callback function can take 0 to 3 optional arguments, in order:
- element Current PortalPrivilege.
- index Current index in array.
- array Reference to PortalPrivilegeListModel.
Returns undefined if no error occurred, and an error message otherwise.
const error = PortalPrivilegeListModel.forEach(function(element, index, array) { ... }); if (error) { console.error(error.message); }
PortalPrivilege get(int index) |
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 method was introduced in Esri::ArcGISRuntime 100.5..