1<?php
2/**
3 * Defines the ACL query.
4 *
5 * PHP version 5
6 *
7 * @category Kolab
8 * @package  Kolab_Storage
9 * @author   Gunnar Wrobel <wrobel@pardus.de>
10 * @license  http://www.horde.org/licenses/lgpl21 LGPL 2.1
11 */
12
13/**
14 * Defines the ACL query.
15 *
16 * Copyright 2011-2017 Horde LLC (http://www.horde.org/)
17 *
18 * See the enclosed file COPYING for license information (LGPL). If you
19 * did not receive this file, see http://www.horde.org/licenses/lgpl21.
20 *
21 * @category Kolab
22 * @package  Kolab_Storage
23 * @author   Gunnar Wrobel <wrobel@pardus.de>
24 * @license  http://www.horde.org/licenses/lgpl21 LGPL 2.1
25 */
26abstract class Horde_Kolab_Storage_List_Query_Acl
27{
28    /**
29     * Does the backend support ACL?
30     *
31     * @return boolean True if the backend supports ACLs.
32     */
33    abstract public function hasAclSupport();
34
35    /**
36     * Retrieve the access rights for a folder. This method will use two calls
37     * to the backend. It will first get the individual user rights via
38     * getMyRights and will subsequently fetch all ACL if the user has admin
39     * rights on a folder. If you already know the user has admin rights on a
40     * folder it makes more sense to call getAllAcl() directly.
41     *
42     * @param string $folder The folder to retrieve the ACL for.
43     *
44     * @return array An array of rights.
45     */
46    abstract public function getAcl($folder);
47
48    /**
49     * Retrieve the access rights the current user has on a folder.
50     *
51     * @param string $folder The folder to retrieve the user ACL for.
52     *
53     * @return string The user rights.
54     */
55    abstract public function getMyAcl($folder);
56
57    /**
58     * Retrieve the all access rights on a folder.
59     *
60     * @param string $folder The folder to retrieve the ACL for.
61     *
62     * @return string The folder rights.
63     */
64    abstract public function getAllAcl($folder);
65
66    /**
67     * Set the access rights for a folder.
68     *
69     * @param string $folder  The folder to act upon.
70     * @param string $user    The user to set the ACL for.
71     * @param string $acl     The ACL.
72     *
73     * @return NULL
74     */
75    abstract public function setAcl($folder, $user, $acl);
76
77    /**
78     * Delete the access rights for user on a folder.
79     *
80     * @param string $folder  The folder to act upon.
81     * @param string $user    The user to delete the ACL for
82     *
83     * @return NULL
84     */
85    abstract public function deleteAcl($folder, $user);
86}
87