KIMAP2

acljobbase.cpp
1/*
2 Copyright (c) 2009 Andras Mantia <amantia@kde.org>
3
4 This library is free software; you can redistribute it and/or modify it
5 under the terms of the GNU Library General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or (at your
7 option) any later version.
8
9 This library is distributed in the hope that it will be useful, but WITHOUT
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12 License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to the
16 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17 02110-1301, USA.
18*/
19
20#include "acljobbase.h"
21#include "acljobbase_p.h"
22#include "message_p.h"
23#include "session_p.h"
24
25using namespace KIMAP2;
26
27void AclJobBasePrivate::setIdentifier(const QByteArray &identifier)
28{
29 id = identifier;
30}
31
32QByteArray AclJobBasePrivate::identifier() const
33{
34 return id;
35}
36
37bool AclJobBasePrivate::hasRightEnabled(Acl::Right right)
38{
39 return rightList & right;
40}
41
42void AclJobBasePrivate::setRights(const QByteArray &rights)
43{
44 switch (rights[0]) {
45 case '+':
46 modifier = AclJobBase::Add;
47 break;
48 case '-':
49 modifier = AclJobBase::Remove;
50 break;
51 default:
52 modifier = AclJobBase::Change;
53 break;
54 }
55
56 rightList = Acl::rightsFromString(rights);
57}
58
59void AclJobBasePrivate::setRights(AclJobBase::AclModifier _modifier, Acl::Rights rights)
60{
61 modifier = _modifier;
62 rightList = rights;
63}
64
65AclJobBase::AclJobBase(Session *session)
66 : Job(*new AclJobBasePrivate(session, "AclJobBase"))
67{
68}
69
70AclJobBase::AclJobBase(JobPrivate &dd)
71 : Job(dd)
72{
73
74}
75
76AclJobBase::~AclJobBase()
77{
78}
79
80void AclJobBase::setMailBox(const QString &mailBox)
81{
83 d->mailBox = mailBox;
84}
85
87{
88 Q_D(const AclJobBase);
89 return d->mailBox;
90}
Base class for jobs that operate on mailbox ACLs.
Definition acljobbase.h:45
void setMailBox(const QString &mailBox)
Set the mailbox to act on.
AclModifier
Used when subclassing to specify how the ACL will be modified.
Definition acljobbase.h:58
QString mailBox() const
The mailbox that will be acted upon.
Right
Possible rights that can be held on a mailbox.
Definition acl.h:39
KIMAP2_EXPORT Rights rightsFromString(const QByteArray &string)
Convert the text form of a set of rights into a Rights bitflag.
Definition acl.cpp:69
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 Nov 29 2024 11:56:35 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.