KIMAP

acljobbase.cpp
1/*
2 SPDX-FileCopyrightText: 2009 Andras Mantia <amantia@kde.org>
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
14using namespace KIMAP;
15
16void AclJobBasePrivate::setIdentifier(const QByteArray &identifier)
17{
18 id = identifier;
19}
20
21QByteArray AclJobBasePrivate::identifier() const
22{
23 return id;
24}
25
26bool AclJobBasePrivate::hasRightEnabled(Acl::Right right) const
27{
28 return rightList & right;
29}
30
31void 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
48void 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
55AclJobBase::AclJobBase(Session *session)
56 : Job(*new AclJobBasePrivate(session, i18n("AclJobBase")))
57{
58}
59
60AclJobBase::AclJobBase(JobPrivate &dd)
61 : Job(dd)
62{
63}
64
65AclJobBase::~AclJobBase()
66{
67}
68
69void AclJobBase::setMailBox(const QString &mailBox)
70{
72 d->mailBox = mailBox;
73}
74
76{
77 Q_D(const AclJobBase);
78 return d->mailBox;
79}
80
81#include "moc_acljobbase.cpp"
Base class for jobs that operate on mailbox ACLs.
Definition acljobbase.h:30
AclModifier
Used when subclassing to specify how the ACL will be modified.
Definition acljobbase.h:43
void setMailBox(const QString &mailBox)
Set the mailbox to act on.
QString mailBox() const
The mailbox that will be acted upon.
QString i18n(const char *text, const TYPE &arg...)
KIMAP_EXPORT Rights rightsFromString(const QByteArray &string)
Convert the text form of a set of rights into a Rights bitflag.
Definition acl.cpp:55
Right
Possible rights that can be held on a mailbox.
Definition acl.h:23
QTextStream & right(QTextStream &stream)
Q_D(Todo)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 27 2024 11:50:28 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.