xref: /plugin/davcal/vendor/sabre/dav/lib/DAVACL/IACL.php (revision a1a3b6794e0e143a4a8b51d3185ce2d339be61ab)
1*a1a3b679SAndreas Boehler<?php
2*a1a3b679SAndreas Boehler
3*a1a3b679SAndreas Boehlernamespace Sabre\DAVACL;
4*a1a3b679SAndreas Boehler
5*a1a3b679SAndreas Boehleruse Sabre\DAV;
6*a1a3b679SAndreas Boehler
7*a1a3b679SAndreas Boehler/**
8*a1a3b679SAndreas Boehler * ACL-enabled node
9*a1a3b679SAndreas Boehler *
10*a1a3b679SAndreas Boehler * If you want to add WebDAV ACL to a node, you must implement this class
11*a1a3b679SAndreas Boehler *
12*a1a3b679SAndreas Boehler * @copyright Copyright (C) 2007-2015 fruux GmbH (https://fruux.com/).
13*a1a3b679SAndreas Boehler * @author Evert Pot (http://evertpot.com/)
14*a1a3b679SAndreas Boehler * @license http://sabre.io/license/ Modified BSD License
15*a1a3b679SAndreas Boehler */
16*a1a3b679SAndreas Boehlerinterface IACL extends DAV\INode {
17*a1a3b679SAndreas Boehler
18*a1a3b679SAndreas Boehler    /**
19*a1a3b679SAndreas Boehler     * Returns the owner principal
20*a1a3b679SAndreas Boehler     *
21*a1a3b679SAndreas Boehler     * This must be a url to a principal, or null if there's no owner
22*a1a3b679SAndreas Boehler     *
23*a1a3b679SAndreas Boehler     * @return string|null
24*a1a3b679SAndreas Boehler     */
25*a1a3b679SAndreas Boehler    function getOwner();
26*a1a3b679SAndreas Boehler
27*a1a3b679SAndreas Boehler    /**
28*a1a3b679SAndreas Boehler     * Returns a group principal
29*a1a3b679SAndreas Boehler     *
30*a1a3b679SAndreas Boehler     * This must be a url to a principal, or null if there's no owner
31*a1a3b679SAndreas Boehler     *
32*a1a3b679SAndreas Boehler     * @return string|null
33*a1a3b679SAndreas Boehler     */
34*a1a3b679SAndreas Boehler    function getGroup();
35*a1a3b679SAndreas Boehler
36*a1a3b679SAndreas Boehler    /**
37*a1a3b679SAndreas Boehler     * Returns a list of ACE's for this node.
38*a1a3b679SAndreas Boehler     *
39*a1a3b679SAndreas Boehler     * Each ACE has the following properties:
40*a1a3b679SAndreas Boehler     *   * 'privilege', a string such as {DAV:}read or {DAV:}write. These are
41*a1a3b679SAndreas Boehler     *     currently the only supported privileges
42*a1a3b679SAndreas Boehler     *   * 'principal', a url to the principal who owns the node
43*a1a3b679SAndreas Boehler     *   * 'protected' (optional), indicating that this ACE is not allowed to
44*a1a3b679SAndreas Boehler     *      be updated.
45*a1a3b679SAndreas Boehler     *
46*a1a3b679SAndreas Boehler     * @return array
47*a1a3b679SAndreas Boehler     */
48*a1a3b679SAndreas Boehler    function getACL();
49*a1a3b679SAndreas Boehler
50*a1a3b679SAndreas Boehler    /**
51*a1a3b679SAndreas Boehler     * Updates the ACL
52*a1a3b679SAndreas Boehler     *
53*a1a3b679SAndreas Boehler     * This method will receive a list of new ACE's as an array argument.
54*a1a3b679SAndreas Boehler     *
55*a1a3b679SAndreas Boehler     * @param array $acl
56*a1a3b679SAndreas Boehler     * @return void
57*a1a3b679SAndreas Boehler     */
58*a1a3b679SAndreas Boehler    function setACL(array $acl);
59*a1a3b679SAndreas Boehler
60*a1a3b679SAndreas Boehler    /**
61*a1a3b679SAndreas Boehler     * Returns the list of supported privileges for this node.
62*a1a3b679SAndreas Boehler     *
63*a1a3b679SAndreas Boehler     * The returned data structure is a list of nested privileges.
64*a1a3b679SAndreas Boehler     * See Sabre\DAVACL\Plugin::getDefaultSupportedPrivilegeSet for a simple
65*a1a3b679SAndreas Boehler     * standard structure.
66*a1a3b679SAndreas Boehler     *
67*a1a3b679SAndreas Boehler     * If null is returned from this method, the default privilege set is used,
68*a1a3b679SAndreas Boehler     * which is fine for most common usecases.
69*a1a3b679SAndreas Boehler     *
70*a1a3b679SAndreas Boehler     * @return array|null
71*a1a3b679SAndreas Boehler     */
72*a1a3b679SAndreas Boehler    function getSupportedPrivilegeSet();
73*a1a3b679SAndreas Boehler
74*a1a3b679SAndreas Boehler
75*a1a3b679SAndreas Boehler}
76