Skip To Content ArcGIS for Developers Sign In Dashboard

PortalPrivilegeListModel Class


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

Header: #include <PortalPrivilegeListModel>
Since: Esri::ArcGISRuntime 100.0
Inherits: QAbstractListModel and Iterable<PortalPrivilege>

Public Types

enum PortalPrivilegeRoles { PortalPrivilegeRealmRole, PortalPrivilegeRoleRole, PortalPrivilegeTypeRole, TypeNameRole }

Public Functions

PortalPrivilege at(int index) const
bool contains(const PortalPrivilege &portalPrivilege) const
PortalPrivilege first() const
int indexOf(const PortalPrivilege &portalPrivilege) const
bool isEmpty() const
PortalPrivilege last() const
int size() const

Reimplemented Public Functions

virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const


void errorOccurred(Esri::ArcGISRuntime::Error error)
void portalPrivilegeAdded(int index)
void portalPrivilegeRemoved(int index)

Additional Inherited Members

Detailed Description

Represents the set of privileges possessed by a portal user.

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:

portalPrivilegeRealmPortalPrivilegeRealmThe realm the privilege belongs to.PortalPrivilegeRealmRole
portalPrivilegeRolePortalPrivilegeRoleThe role the privilege applies to.PortalPrivilegeRoleRole
portalPrivilegeTypePortalPrivilegeTypeThe operation permitted by the privilege.PortalPrivilegeTypeRole
typeNameQStringThe type name of the privilege.TypeNameRole


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

    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.

Member Type Documentation

enum PortalPrivilegeListModel::PortalPrivilegeRoles

This enum specifies the custom roles which can be used with PortalPrivilegeListModel::data.

Esri::ArcGISRuntime::PortalPrivilegeListModel::PortalPrivilegeRealmRoleQt::UserRole + 1The realm the privilege belongs to.
Esri::ArcGISRuntime::PortalPrivilegeListModel::PortalPrivilegeRoleRoleQt::UserRole + 2The role the privilege applies to.
Esri::ArcGISRuntime::PortalPrivilegeListModel::PortalPrivilegeTypeRoleQt::UserRole + 3The operation permitted by the privilege.
Esri::ArcGISRuntime::PortalPrivilegeListModel::TypeNameRoleQt::UserRole + 4The type name of the privilege.

Member Function Documentation



PortalPrivilege PortalPrivilegeListModel::at(int index) const

Returns the PortalPrivilege at the specified index.

bool PortalPrivilegeListModel::contains(const PortalPrivilege &portalPrivilege) const

Returns whether the list model contains the specified portalPrivilege.

[virtual] QVariant PortalPrivilegeListModel::data(const QModelIndex &index, int role = Qt::DisplayRole) const

Reimplemented from QAbstractItemModel::data().

Returns the data stored under the given role for the privilege referred to by the index.

  • index. The index in the model for which to return data.
  • role. The role for which to return data.

[signal] void PortalPrivilegeListModel::errorOccurred(Esri::ArcGISRuntime::Error error)

Signal emitted when an error occurs.

  • error - Details about the error.

PortalPrivilege PortalPrivilegeListModel::first() const

Returns the first PortalPrivilege in the list model.

int PortalPrivilegeListModel::indexOf(const PortalPrivilege &portalPrivilege) const

Returns the index of the PortalPrivilege portalPrivilege.

bool PortalPrivilegeListModel::isEmpty() const

Returns whether the list model is empty (contains no privileges).

PortalPrivilege PortalPrivilegeListModel::last() const

Returns the last PortalPrivilege in the list model.

[signal] void PortalPrivilegeListModel::portalPrivilegeAdded(int index)

Signal emitted when a PortalPrivilege is added to the list model.

index is the index of the added privilege.

[signal] void PortalPrivilegeListModel::portalPrivilegeRemoved(int index)

Signal emitted when a PortalPrivilege is removed from the list model.

index is the index of the removed privilege.

int PortalPrivilegeListModel::size() const

Returns the number of privileges contained in the list model.

Feedback on this topic?