KIMAP

myrightsjob.h
1/*
2 SPDX-FileCopyrightText: 2009 Andras Mantia <amantia@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "kimap_export.h"
10
11#include "acljobbase.h"
12
13namespace KIMAP
14{
15class Session;
16struct Response;
17class MyRightsJobPrivate;
18
19/**
20 * Determine the rights the currently-logged-in user
21 * has on the current mailbox.
22 *
23 * This should take into account the full access control
24 * list.
25 *
26 * This job can only be run when the session is in the
27 * authenticated (or selected) state.
28 *
29 * The current user must have one of the following rights
30 * on the mailbox for this job to succeed:
31 * - Acl::Lookup
32 * - Acl::Read
33 * - Acl::Insert
34 * - Acl::CreateMailbox
35 * - Acl::DeleteMailbox
36 * - Acl::Admin
37 *
38 * This job requires that the server supports the ACL
39 * capability, defined in
40 * <a href="https://tools.ietf.org/html/rfc4314">RFC 4314</a>.
41 */
42class KIMAP_EXPORT MyRightsJob : public AclJobBase
43{
44 Q_OBJECT
45 Q_DECLARE_PRIVATE(MyRightsJob)
46
47 friend class SessionPrivate;
48
49public:
50 explicit MyRightsJob(Session *session);
51 ~MyRightsJob() override;
52
53 /**
54 * Check whether the current user has the a particular right
55 * on the mailbox.
56 *
57 * The result of this method is undefined if the job has
58 * not yet completed.
59 *
60 * @param right the right to check for
61 */
62 [[nodiscard]] bool hasRightEnabled(Acl::Right right);
63 /**
64 * Get the rights for the current user on the mailbox.
65 *
66 * The result of this method is undefined if the job has
67 * not yet completed.
68 */
69 [[nodiscard]] Acl::Rights rights();
70
71protected:
72 void doStart() override;
73 void handleResponse(const Response &response) override;
74};
75
76}
Base class for jobs that operate on mailbox ACLs.
Definition acljobbase.h:30
Determine the rights the currently-logged-in user has on the current mailbox.
Definition myrightsjob.h:43
Right
Possible rights that can be held on a mailbox.
Definition acl.h:23
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 20 2024 11:51:44 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.