KIMAP

acljobbase.cpp
1 /*
2  SPDX-FileCopyrightText: 2009 Andras Mantia <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #include "acljobbase.h"
8 #include "acljobbase_p.h"
9 #include "response_p.h"
10 #include "session_p.h"
11 
12 #include <KLocalizedString>
13 
14 using namespace KIMAP;
15 
16 void AclJobBasePrivate::setIdentifier(const QByteArray &identifier)
17 {
18  id = identifier;
19 }
20 
21 QByteArray AclJobBasePrivate::identifier() const
22 {
23  return id;
24 }
25 
26 bool AclJobBasePrivate::hasRightEnabled(Acl::Right right) const
27 {
28  return rightList & right;
29 }
30 
31 void AclJobBasePrivate::setRights(const QByteArray &rights)
32 {
33  switch (rights[0]) {
34  case '+':
35  modifier = AclJobBase::Add;
36  break;
37  case '-':
38  modifier = AclJobBase::Remove;
39  break;
40  default:
41  modifier = AclJobBase::Change;
42  break;
43  }
44 
45  rightList = Acl::rightsFromString(rights);
46 }
47 
48 void AclJobBasePrivate::setRights(AclJobBase::AclModifier _modifier, Acl::Rights rights)
49 {
50  modifier = _modifier;
51  // XXX: [alexmerry, 2010-07-24]: this is REALLY unintuitive behaviour
52  rightList |= rights;
53 }
54 
55 AclJobBase::AclJobBase(Session *session)
56  : Job(*new AclJobBasePrivate(session, i18n("AclJobBase")))
57 {
58 }
59 
60 AclJobBase::AclJobBase(JobPrivate &dd)
61  : Job(dd)
62 {
63 
64 }
65 
66 AclJobBase::~AclJobBase()
67 {
68 }
69 
70 void AclJobBase::setMailBox(const QString &mailBox)
71 {
72  Q_D(AclJobBase);
73  d->mailBox = mailBox;
74 }
75 
77 {
78  Q_D(const AclJobBase);
79  return d->mailBox;
80 }
Right
Possible rights that can be held on a mailbox.
Definition: acl.h:26
QString i18n(const char *text, const TYPE &arg...)
AclModifier
Used when subclassing to specify how the ACL will be modified.
Definition: acljobbase.h:45
KIMAP_EXPORT Rights rightsFromString(const QByteArray &string)
Convert the text form of a set of rights into a Rights bitflag.
Definition: acl.cpp:56
void setMailBox(const QString &mailBox)
Set the mailbox to act on.
Definition: acljobbase.cpp:70
Definition: acl.cpp:12
QString mailBox() const
The mailbox that will be acted upon.
Definition: acljobbase.cpp:76
Base class for jobs that operate on mailbox ACLs.
Definition: acljobbase.h:31
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Nov 30 2020 23:12:58 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.