1: <?php
2: /**
3: * Maps a single Horde creator permission element to a Kolab_Storage ACL.
4: *
5: * PHP version 5
6: *
7: * @category Horde
8: * @package Perms
9: * @author Gunnar Wrobel <wrobel@pardus.de>
10: * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
11: * @link http://pear.horde.org/index.php?package=Perms
12: */
13:
14: /**
15: * Maps a single Horde creator permission element to a Kolab_Storage ACL.
16: *
17: * Copyright 2006-2012 Horde LLC (http://www.horde.org/)
18: *
19: * See the enclosed file COPYING for license information (LGPL). If you
20: * did not receive this file, see http://www.horde.org/licenses/lgpl21.
21: *
22: * @category Horde
23: * @package Perms
24: * @author Gunnar Wrobel <wrobel@pardus.de>
25: * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
26: * @link http://pear.horde.org/index.php?package=Perms
27: */
28: class Horde_Perms_Permission_Kolab_Element_Creator
29: extends Horde_Perms_Permission_Kolab_Element
30: {
31: /**
32: * The creator id.
33: *
34: * @var string
35: */
36: private $_creator;
37:
38: /**
39: * Constructor.
40: *
41: * @param int $permission The folder permission as provided by Horde.
42: * @param string $creator The folder owner.
43: */
44: public function __construct($permission, $creator)
45: {
46: $this->_creator = $creator;
47: parent::__construct($permission);
48: }
49:
50: /**
51: * Convert the Horde_Perms:: mask to a Acl string.
52: *
53: * @return string The ACL string.
54: */
55: public function fromHorde()
56: {
57: return 'a' . $this->convertMaskToAcl();
58: }
59:
60: /**
61: * Get the Kolab_Storage ACL id for this permission.
62: *
63: * @return string The ACL string.
64: */
65: public function getId()
66: {
67: return $this->_creator;
68: }
69:
70: /**
71: * Unset the element in the provided permission array.
72: *
73: * @param array &$current The current permission array.
74: *
75: * @return NULL
76: */
77: public function unsetInCurrent(&$current)
78: {
79: unset($current['creator']);
80: }
81: }
82: