|
virtual | ~IMUCPerms () |
|
virtual QMap< QByteArray, QList< QByteArray > > | GetPossiblePerms () const =0 |
| Returns all possible permission classes and values. More...
|
|
virtual QMap< QByteArray, QList< QByteArray > > | GetPerms (QObject *participant) const =0 |
| Returns current permissions for the given participant. More...
|
|
virtual QPair< QByteArray, QByteArray > | GetKickPerm () const =0 |
|
virtual QPair< QByteArray, QByteArray > | GetBanPerm () const =0 |
|
virtual QByteArray | GetAffName (QObject *participant) const =0 |
| Returns the name of the affiliation icon. More...
|
|
virtual bool | MayChangePerm (QObject *participant, const QByteArray &permClass, const QByteArray &targetPerm) const =0 |
| Whether given participant's permission may be changed to the given value. More...
|
|
virtual void | SetPerm (QObject *participant, const QByteArray &permClass, const QByteArray &targetPerm, const QString &reason)=0 |
| Sets the permission for the given participant. More...
|
|
virtual bool | IsLessByPerm (QObject *part1, QObject *part2) const =0 |
| Returns if one participant has less perms than another. More...
|
|
virtual bool | IsMultiPerm (const QByteArray &permClass) const =0 |
| Returns whether users can have many perms of the given class at once. More...
|
|
virtual QString | GetUserString (const QByteArray &id) const =0 |
| Returns a human-readable string for the given id. More...
|
|
virtual void | TrySetPerm (const QString &userId, const QByteArray &permClass, const QByteArray &targetPerm, const QString &reason) |
| Sets a perm on a user not present in the room. More...
|
|
This interface describes permissions in the given room.
If a room supports getting/changing permissions for participants, this interface should be implemented by the room's CL entry object.
There may be different permission classes in a room, and each permission class has several permission variants, which are exclusive, while permissions from different classes are not exclusive.
For example, an XMPP MUC room has two permission classes: roles and affiliations. Role class and affiliation class have a different set of permissions, like participant/moderator or outcast/member/admin respectively.
Definition at line 49 of file imucperms.h.
virtual QMap<QByteArray, QList<QByteArray> > LC::Azoth::IMUCPerms::GetPossiblePerms |
( |
| ) |
const |
|
pure virtual |
Returns all possible permission classes and values.
Returns all possible permission classes and values for this MUC. In the map, the key is used as the permission class identifier, while the corresponding list of QByteArrays is the list of permission variants for this class.
Please note that this list should not change between calls to this method.
- Returns
- The possible permissions for this room.
virtual bool LC::Azoth::IMUCPerms::MayChangePerm |
( |
QObject * |
participant, |
|
|
const QByteArray & |
permClass, |
|
|
const QByteArray & |
targetPerm |
|
) |
| const |
|
pure virtual |
Whether given participant's permission may be changed to the given value.
This function is used to query whether at this moment the permission from the given permClass could be set to the targetPerm value by our user.
targetPerm is one of the corresponding values from the map returned from GetPossiblePerms() map.
In case of failure (for example, participant doesn't belong to this room), this function should return false.
- Parameters
-
[in] | participant | The participant to query. |
[in] | permClass | Permission class to operate in. |
[in] | targetPerm | Target permission in that class. |
- Returns
- Whether permission could be set successfully.
virtual void LC::Azoth::IMUCPerms::SetPerm |
( |
QObject * |
participant, |
|
|
const QByteArray & |
permClass, |
|
|
const QByteArray & |
targetPerm, |
|
|
const QString & |
reason |
|
) |
| |
|
pure virtual |
Sets the permission for the given participant.
This function is used to set the participant's permission from the given permClass to the given targetPerm value (which is one of returned from GetPossiblePerms() for that class). If applicable, reason is used to describe the reason for changing the permission, which may be extremely useful, for example, when kicking or banning.
- Parameters
-
[in] | participant | The participant to change the permission for. |
[in] | permClass | The permission class to update. |
[in] | targetPerm | The target permission in the given permission class. |
[in] | reason | The reason of the permission change. |
- See also
- TrySetPerm
virtual void LC::Azoth::IMUCPerms::TrySetPerm |
( |
const QString & |
userId, |
|
|
const QByteArray & |
permClass, |
|
|
const QByteArray & |
targetPerm, |
|
|
const QString & |
reason |
|
) |
| |
|
inlinevirtual |
Sets a perm on a user not present in the room.
This function tries to set a given targetPerm of the given permClass on the user identified by the given userId. The user may or may not be present in the room at the moment. The userId should be the same as would be returned by ICLEntry::GetHumanReadableID() if the user was present in the room.
It is OK for the function to do nothing.
- Parameters
-
[in] | userId | The ID of the user to change the permission for. |
[in] | permClass | The permission class to update. |
[in] | targetPerm | The target permission in the given permission class. |
[in] | reason | The reason of the permission change. |
- See also
- SetPerm()
Definition at line 205 of file imucperms.h.