1<?php
2/**
3 * Horde_Perms_Null
4 *
5 * Copyright 2011-2017 Horde LLC (http://www.horde.org/)
6 *
7 * See the enclosed file COPYING for license information (LGPL). If you
8 * did not receive this file, see http://www.horde.org/licenses/lgpl21.
9 *
10 * @author   Jan Schneider <jan@horde.org>
11 * @category Horde
12 * @package  Perms
13 */
14class Horde_Perms_Null extends Horde_Perms_Base
15{
16    /**
17     * Returns a new permissions object.
18     *
19     * @param string $name   The permission's name.
20     * @param string $type   The permission type.
21     * @param array $params  The permission parameters.
22     *
23     * @return Horde_Perms_Permission  A new permissions object.
24     * @throws Horde_Perms_Exception
25     */
26    public function newPermission($name, $type = 'matrix', $params = null)
27    {
28        throw new Horde_Perms_Exception();
29    }
30
31    /**
32     * Returns an object corresponding to the named permission, with the users
33     * and other data retrieved appropriately.
34     *
35     * @param string $name  The name of the permission to retrieve.
36     *
37     * @return Horde_Perms_Permission  A permissions object.
38     * @throws Horde_Perms_Exception
39     */
40    public function getPermission($name)
41    {
42        throw new Horde_Perms_Exception();
43    }
44
45    /**
46     * Returns an object corresponding to the given unique ID, with the users
47     * and other data retrieved appropriately.
48     *
49     * @param integer $cid  The unique ID of the permission to retrieve.
50     *
51     * @return Horde_Perms_Permission  A permissions object.
52     * @throws Horde_Perms_Exception
53     */
54    public function getPermissionById($cid)
55    {
56        throw new Horde_Perms_Exception();
57    }
58
59    /**
60     * Adds a permission to the permissions system. The permission must first
61     * be created with newPermission(), and have any initial users added to
62     * it, before this function is called.
63     *
64     * @param Horde_Perms_Permission $perm  The permissions object.
65     *
66     * @throws Horde_Perms_Exception
67     */
68    public function addPermission(Horde_Perms_Permission $perm)
69    {
70        throw new Horde_Perms_Exception();
71    }
72
73    /**
74     * Removes a permission from the permissions system permanently.
75     *
76     * @param Horde_Perms_Permission $perm  The permission to remove.
77     * @param boolean $force                Force to remove every child.
78     *
79     * @throws Horde_Perms_Exception
80     */
81    public function removePermission(Horde_Perms_Permission $perm,
82                                     $force = false)
83    {
84        throw new Horde_Perms_Exception();
85    }
86
87    /**
88     * Returns the unique identifier of this permission.
89     *
90     * @param Horde_Perms_Permission $permission  The permission object to get
91     *                                            the ID of.
92     *
93     * @return integer  The unique id.
94     * @throws Horde_Perms_Exception
95     */
96    public function getPermissionId($permission)
97    {
98        throw new Horde_Perms_Exception();
99    }
100
101    /**
102     * Checks if a permission exists in the system.
103     *
104     * @param string $permission  The permission to check.
105     *
106     * @return boolean  True if the permission exists.
107     */
108    public function exists($permission)
109    {
110        return false;
111    }
112
113    /**
114     * Returns a list of parent permissions.
115     *
116     * @param string $child  The name of the child to retrieve parents for.
117     *
118     * @return array  A hash with all parents in a tree format.
119     * @throws Horde_Perms_Exception
120     */
121    public function getParents($child)
122    {
123        throw new Horde_Perms_Exception();
124    }
125
126    /**
127     * Returns all permissions of the system in a tree format.
128     *
129     * @return array  A hash with all permissions in a tree format.
130     */
131    public function getTree()
132    {
133        return array();
134    }
135}
136