|
0
|
1 |
<?php |
|
|
2 |
|
|
|
3 |
/* |
|
|
4 |
* This file is part of the Symfony package. |
|
|
5 |
* |
|
|
6 |
* (c) Fabien Potencier <fabien@symfony.com> |
|
|
7 |
* |
|
|
8 |
* For the full copyright and license information, please view the LICENSE |
|
|
9 |
* file that was distributed with this source code. |
|
|
10 |
*/ |
|
|
11 |
|
|
|
12 |
namespace Symfony\Component\Security\Acl\Domain; |
|
|
13 |
|
|
|
14 |
use Symfony\Component\Security\Acl\Model\AclInterface; |
|
|
15 |
use Symfony\Component\Security\Acl\Model\FieldEntryInterface; |
|
|
16 |
use Symfony\Component\Security\Acl\Model\SecurityIdentityInterface; |
|
|
17 |
|
|
|
18 |
/** |
|
|
19 |
* Field-aware ACE implementation which is auditable |
|
|
20 |
* |
|
|
21 |
* @author Johannes M. Schmitt <schmittjoh@gmail.com> |
|
|
22 |
*/ |
|
|
23 |
class FieldEntry extends Entry implements FieldEntryInterface |
|
|
24 |
{ |
|
|
25 |
private $field; |
|
|
26 |
|
|
|
27 |
/** |
|
|
28 |
* Constructor |
|
|
29 |
* |
|
|
30 |
* @param integer $id |
|
|
31 |
* @param AclInterface $acl |
|
|
32 |
* @param string $field |
|
|
33 |
* @param SecurityIdentityInterface $sid |
|
|
34 |
* @param string $strategy |
|
|
35 |
* @param integer $mask |
|
|
36 |
* @param Boolean $granting |
|
|
37 |
* @param Boolean $auditFailure |
|
|
38 |
* @param Boolean $auditSuccess |
|
|
39 |
* @return void |
|
|
40 |
*/ |
|
|
41 |
public function __construct($id, AclInterface $acl, $field, SecurityIdentityInterface $sid, $strategy, $mask, $granting, $auditFailure, $auditSuccess) |
|
|
42 |
{ |
|
|
43 |
parent::__construct($id, $acl, $sid, $strategy, $mask, $granting, $auditFailure, $auditSuccess); |
|
|
44 |
|
|
|
45 |
$this->field = $field; |
|
|
46 |
} |
|
|
47 |
|
|
|
48 |
/** |
|
|
49 |
* {@inheritDoc} |
|
|
50 |
*/ |
|
|
51 |
public function getField() |
|
|
52 |
{ |
|
|
53 |
return $this->field; |
|
|
54 |
} |
|
|
55 |
|
|
|
56 |
/** |
|
|
57 |
* {@inheritDoc} |
|
|
58 |
*/ |
|
|
59 |
public function serialize() |
|
|
60 |
{ |
|
|
61 |
return serialize(array( |
|
|
62 |
$this->field, |
|
|
63 |
parent::serialize(), |
|
|
64 |
)); |
|
|
65 |
} |
|
|
66 |
|
|
|
67 |
/** |
|
|
68 |
* {@inheritDoc} |
|
|
69 |
*/ |
|
|
70 |
public function unserialize($serialized) |
|
|
71 |
{ |
|
|
72 |
list($this->field, $parentStr) = unserialize($serialized); |
|
|
73 |
parent::unserialize($parentStr); |
|
|
74 |
} |
|
|
75 |
} |