• PortalPrivilegeListModel
  • class Esri::ArcGISRuntime::PortalPrivilegeListModel

    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:

    RoleTypeDescriptionPortalPrivilegeRoles
    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
    portalPrivilegeSubtypePortalPrivilegeSubtypeThe fine-grained operation permitted by the privilege.PortalPrivilegeSubtypeRole
    subtypeNameQStringThe 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.

    ConstantValueDescription
    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.
    Esri::ArcGISRuntime::PortalPrivilegeListModel::PortalPrivilegeSubtypeRoleQt::UserRole + 5The fine-grained operation permitted by the privilege
    Esri::ArcGISRuntime::PortalPrivilegeListModel::SubtypeNameRoleQt::UserRole + 6The subtype name of the privilege.

    Member Function Documentation

    [override virtual noexcept] 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.