1<?php
2/**
3 * Copyright 2006-2017 Horde LLC (http://www.horde.org/)
4 *
5 * See the enclosed file COPYING for license information (LGPL). If you
6 * did not receive this file, see http://www.horde.org/licenses/lgpl21.
7 *
8 * @category Horde
9 * @package  Perms
10 * @author   Gunnar Wrobel <wrobel@pardus.de>
11 * @license  http://www.horde.org/licenses/lgpl21 LGPL 2.1
12 */
13
14/**
15 * Maps a single Horde user permission element to a Kolab_Storage ACL.
16 *
17 * @category Horde
18 * @package  Perms
19 * @author   Gunnar Wrobel <wrobel@pardus.de>
20 * @license  http://www.horde.org/licenses/lgpl21 LGPL 2.1
21 */
22class Horde_Perms_Permission_Kolab_Element_User
23extends Horde_Perms_Permission_Kolab_Element
24{
25    /**
26     * The group id.
27     *
28     * @var string
29     */
30    protected $_id;
31
32    /**
33     * Constructor.
34     *
35     * @param int    $permission The folder permission as provided by Horde.
36     * @param string $id         The user id.
37     */
38    public function __construct($permission, $id)
39    {
40        $this->_id = $id;
41        parent::__construct($permission);
42    }
43
44    /**
45     * Get the Kolab_Storage ACL id for this permission.
46     *
47     * @return string The ACL string.
48     */
49    public function getId()
50    {
51        return $this->_id;
52    }
53
54    /**
55     * Unset the element in the provided permission array.
56     *
57     * @param array &$current The current permission array.
58     */
59    public function unsetInCurrent(&$current)
60    {
61        unset($current['users'][$this->getId()]);
62    }
63}
64