22#include <QtCore/QByteArray>
59 QMap<char, Right> map;
62K_GLOBAL_STATIC( RightsMap, globalRights )
71 if (
string.isEmpty() ) {
76 if (
string[0] ==
'+' ||
string[0] ==
'-' ) {
80 for (
int i = pos; i <
string.size(); i++ ) {
81 if ( globalRights->map.contains(
string[i] ) ) {
82 result|= globalRights->map[
string[i]];
94 if ( rights & right ) {
95 result += globalRights->map.key( (
Right)right );
104 Rights normalized = rights;
105 if ( normalized & Create ) {
106 normalized |= ( CreateMailbox | DeleteMailbox );
107 normalized &= ~Create;
109 if ( normalized & Delete ) {
110 normalized |= ( DeleteMessage | Expunge );
111 normalized &= ~Delete;
119 if ( denormalized & ( CreateMailbox | DeleteMailbox ) ) {
122 if ( denormalized & ( DeleteMessage | Expunge ) ) {
Rights rightsFromString(const QByteArray &string)
Convert the text form of a set of rights into a Rights bitflag.
QByteArray rightsToString(Rights rights)
Convert a set of rights into text format.
Right
Possible rights that can be held on a mailbox.
@ Expunge
Expunge the messages in this mailbox.
@ WriteShared
Write shared annotations.
@ CreateMailbox
Create new child mailboxes, or move a mailbox with this mailbox as the new parent.
@ Delete
Obsolete as of RFC 4314, replaced by DeleteMessage and Expunge.
@ Custom3
Server-specific right 3.
@ KeepSeen
Set or clear the \Seen flag on messages in the mailbox, and keep it across sessions.
@ Custom9
Server-specific right 9.
@ Admin
View and modify the access control list for the mailbox.
@ Create
Obsolete as of RFC 4314, replaced by CreateMailbox and DeleteMailbox.
@ Insert
Perform APPEND and COPY with the mailbox as the target.
@ Custom5
Server-specific right 5.
@ Custom0
Server-specific right 0.
@ Custom2
Server-specific right 2.
@ Lookup
Mailbox is visible to LIST/LSUB commands, SUBSCRIBE mailbox.
@ Custom1
Server-specific right 1.
@ Custom4
Server-specific right 4.
@ Custom7
Server-specific right 7.
@ Post
Send mail to the submission address for the mailbox.
@ DeleteMessage
Set or clear the \Deleted flag on messages in the mailbox.
@ Custom6
Server-specific right 6.
@ Read
SELECT the mailbox, perform STATUS.
@ Write
Set or clear flags other than \Seen and \Deleted on messages in the mailbox.
@ Custom8
Server-specific right 8.
@ DeleteMailbox
Delete or move the mailbox.
Rights denormalizedRights(Rights rights)
Returns a rights mask that contains both obsolete and new flags if one of them is set.
Rights normalizedRights(Rights rights)
Returns a rights mask that has no obsolete members anymore, i.e.