File indexing completed on 2024-06-02 05:31:06

0001 /*
0002  * SPDX-FileCopyrightText: 2010 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
0003  * SPDX-FileCopyrightText: 2010 Tobias Koenig <tokoe@kdab.com>
0004  *
0005  * SPDX-License-Identifier: GPL-2.0-or-later
0006  */
0007 
0008 #pragma once
0009 
0010 #include <KIMAP/Acl>
0011 
0012 namespace PimCommon
0013 {
0014 namespace AclUtils
0015 {
0016 /**
0017  * Returns the number of standard permissions available.
0018  */
0019 uint standardPermissionsCount();
0020 
0021 /**
0022  * Returns the standard permissions at the given @p index.
0023  */
0024 KIMAP::Acl::Rights permissionsForIndex(uint index);
0025 
0026 /**
0027  * Returns the index of the given standard @p permissions.
0028  *
0029  * If there are no matching permissions, @c -1 is returned.
0030  */
0031 int indexForPermissions(KIMAP::Acl::Rights permissions);
0032 
0033 /**
0034  * Returns the i18n'd representation of the given @p permissions.
0035  */
0036 QString permissionsToUserString(KIMAP::Acl::Rights permissions);
0037 
0038 /**
0039  * We call this method if our first try to get the ACLs for the user fails.
0040  * That's the case if the ACLs use a different user id than the login name.
0041  *
0042  * Examples:
0043  *   login: testuser                acls: testuser@mydomain.org
0044  *   login: testuser@mydomain.org   acls: testuser
0045  */
0046 QString guessUserName(const QString &loginName, const QString &serverName);
0047 }
0048 }