Represents the set of privileges possessed by a portal user. More...
Header: | #include <PortalPrivilegeListModel.h> |
Since: | Esri::ArcGISRuntime 100.0 |
Inherits: | QAbstractListModel and Esri::ArcGISRuntime::Iterable |
Public Types
enum | PortalPrivilegeRoles { PortalPrivilegeRealmRole, PortalPrivilegeRoleRole, PortalPrivilegeTypeRole, TypeNameRole, PortalPrivilegeSubtypeRole, SubtypeNameRole } |
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 |
Signals
void | errorOccurred(const Esri::ArcGISRuntime::Error &error) |
void | itemAdded(int index) |
void | itemRemoved(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:
Role | Type | Description | PortalPrivilegeRoles |
---|---|---|---|
portalPrivilegeRealm | PortalPrivilegeRealm | The realm the privilege belongs to. | PortalPrivilegeRealmRole |
portalPrivilegeRole | PortalPrivilegeRole | The role the privilege applies to. | PortalPrivilegeRoleRole |
portalPrivilegeType | PortalPrivilegeType | The operation permitted by the privilege. | PortalPrivilegeTypeRole |
typeName | QString | The type name of the privilege. | TypeNameRole |
portalPrivilegeSubtype | PortalPrivilegeSubtype | The fine-grained operation permitted by the privilege. | PortalPrivilegeSubtypeRole |
subtypeName | QString | The subtype name of the privilege. | SubtypeNameRole |
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.
Member Type Documentation
enum PortalPrivilegeListModel::PortalPrivilegeRoles
This enum specifies the custom roles which can be used with PortalPrivilegeListModel::data.
Constant | Value | Description |
---|---|---|
Esri::ArcGISRuntime::PortalPrivilegeListModel::PortalPrivilegeRealmRole | Qt::UserRole + 1 | The realm the privilege belongs to. |
Esri::ArcGISRuntime::PortalPrivilegeListModel::PortalPrivilegeRoleRole | Qt::UserRole + 2 | The role the privilege applies to. |
Esri::ArcGISRuntime::PortalPrivilegeListModel::PortalPrivilegeTypeRole | Qt::UserRole + 3 | The operation permitted by the privilege. |
Esri::ArcGISRuntime::PortalPrivilegeListModel::TypeNameRole | Qt::UserRole + 4 | The type name of the privilege. |
Esri::ArcGISRuntime::PortalPrivilegeListModel::PortalPrivilegeSubtypeRole | Qt::UserRole + 5 | The fine-grained operation permitted by the privilege |
Esri::ArcGISRuntime::PortalPrivilegeListModel::SubtypeNameRole | Qt::UserRole + 6 | The subtype name of the privilege. |
Member Function Documentation
[override virtual]
PortalPrivilegeListModel::~PortalPrivilegeListModel ()
Destructor.
[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.
[signal]
void PortalPrivilegeListModel::errorOccurred (const Esri::ArcGISRuntime::Error &error)
Signal emitted when an error occurs.
- error - Details about the error.
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).
[signal]
void PortalPrivilegeListModel::itemAdded (int index)
Signal emitted when a PortalPrivilege is added to the list model.
index is the index of the added privilege.
[signal]
void PortalPrivilegeListModel::itemRemoved (int index)
Signal emitted when a PortalPrivilege is removed from the list model.
index is the index of the removed privilege.
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.