Skip To Content ArcGIS for Developers Sign In Dashboard

PortalPrivilegeListModel Class

class Esri::ArcGISRuntime::PortalPrivilegeListModel

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

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

This class was introduced in Esri::ArcGISRuntime 100.0.

Public Types

enum PortalPrivilegeRoles { PortalPrivilegeRealmRole, PortalPrivilegeRoleRole, PortalPrivilegeTypeRole, TypeNameRole }

Public Functions

virtual ~PortalPrivilegeListModel() override
bool contains(const Esri::ArcGISRuntime::PortalPrivilege &portalPrivilege) const
Esri::ArcGISRuntime::PortalPrivilege first() const
int indexOf(const Esri::ArcGISRuntime::PortalPrivilege &portalPrivilege) const
bool isEmpty() const
Esri::ArcGISRuntime::PortalPrivilege last() const

Reimplemented Public Functions

virtual Esri::ArcGISRuntime::PortalPrivilege at(int index) const override
virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override
virtual int size() const override


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

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:

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

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

Signal emitted when an error occurs.

  • error - Details about the error.

[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.

[override virtual] PortalPrivilegeListModel::~PortalPrivilegeListModel()


[override virtual] Esri::ArcGISRuntime::PortalPrivilege PortalPrivilegeListModel::at(int index) const

Returns the PortalPrivilege at the specified index.

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

Returns whether the list model contains the specified portalPrivilege.

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

Reimplements: QAbstractItemModel::data(const QModelIndex &index, int role) const.

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.

Esri::ArcGISRuntime::PortalPrivilege PortalPrivilegeListModel::first() const

Returns the first PortalPrivilege in the list model.

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

Returns the index of the PortalPrivilege portalPrivilege.

bool PortalPrivilegeListModel::isEmpty() const

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

Esri::ArcGISRuntime::PortalPrivilege PortalPrivilegeListModel::last() const

Returns the last PortalPrivilege in the list model.

[override virtual] int PortalPrivilegeListModel::size() const

Returns the number of privileges contained in the list model.

Feedback on this topic?