KIMAP2

setacljob.h
1 /*
2  Copyright (c) 2009 Andras Mantia <[email protected]>
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 #ifndef KIMAP2_SETACLJOB_H
21 #define KIMAP2_SETACLJOB_H
22 
23 #include "kimap2_export.h"
24 
25 #include "acljobbase.h"
26 
27 namespace KIMAP2
28 {
29 
30 class Session;
31 struct Message;
32 class SetAclJobPrivate;
33 
34 /**
35  * Sets the rights that correspond to an identifier on a mailbox
36  *
37  * This job can only be run when the session is in the
38  * authenticated (or selected) state.
39  *
40  * This job requires that the server supports the ACL
41  * capability, defined in
42  * <a href="http://www.apps.ietf.org/rfc/rfc4314.html">RFC 4314</a>.
43  */
44 class KIMAP2_EXPORT SetAclJob : public AclJobBase
45 {
46  Q_OBJECT
47  Q_DECLARE_PRIVATE(SetAclJob)
48 
49  friend class SessionPrivate;
50 
51 public:
52  explicit SetAclJob(Session *session);
53  virtual ~SetAclJob();
54 
55  /**
56  * Sets the rights that will be changed for the identifier
57  *
58  * Note that multiple calls to this method will have a
59  * non-intuitive effect: the @p modifier value of the most
60  * recent call will be used, but the OR'd-together values
61  * of all calls to setRights() will be used.
62  *
63  * If the server does not recognise any of the rights,
64  * the job will fail and the ACL for the mailbox will
65  * remain unchanged.
66  *
67  * Note that some rights may be tied together, and must be set
68  * or removed as a group. See ListRightsJob::possibleRights()
69  * for more details. The server will only set a tied group
70  * of rights if you have requested that all the rights in that
71  * group should be set.
72  *
73  * @param modifier determines whether the rights will be
74  * added to the identifier, removed from
75  * the identifier or will replace any
76  * existing rights assigned to the
77  * identifier
78  * @param rights the rights to be added, removed or set
79  */
80  void setRights(AclModifier modifier, Acl::Rights rights);
81 
82  /**
83  * Sets the identifier the rights will be modified for
84  *
85  * The meaning of identifiers depends on the server implementation,
86  * with the following restrictions:
87  *
88  * - "anyone" means any authenticated user, including anonymous
89  * - an identifier starting with a minus sign ('-') indicates
90  * "negative rights": rights that should be taken away from
91  * matching users
92  *
93  * Other than the above restrictions, ACL identifiers are usually
94  * IMAP usernames, but could potentially be group names as well.
95  *
96  * Note that negative rights override positive rights: if
97  * "fred" and "-fred" are both assigned the 'w' right, the
98  * user "fred" will not have the 'w' right.
99  * @param identifier the identifier to set
100  */
101  void setIdentifier(const QByteArray &identifier);
102  /**
103  * The identifier that rights will be associated with
104  */
105  QByteArray identifier();
106 
107 protected:
108  void doStart() Q_DECL_OVERRIDE;
109 
110 };
111 
112 }
113 
114 #endif
Sets the rights that correspond to an identifier on a mailbox.
Definition: setacljob.h:44
AclModifier
Used when subclassing to specify how the ACL will be modified.
Definition: acljobbase.h:58
Base class for jobs that operate on mailbox ACLs.
Definition: acljobbase.h:44
Definition: acl.cpp:25
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Nov 29 2021 23:00:39 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.