-
-
Notifications
You must be signed in to change notification settings - Fork 221
/
NodePrivilegeSubject.php
58 lines (51 loc) · 1.45 KB
/
NodePrivilegeSubject.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php
namespace Neos\ContentRepository\Security\Authorization\Privilege\Node;
/*
* This file is part of the Neos.ContentRepository package.
*
* (c) Contributors of the Neos Project - www.neos.io
*
* This package is Open Source Software. For the full copyright and license
* information, please view the LICENSE file which was distributed with this
* source code.
*/
use Neos\Flow\Aop\JoinPointInterface;
use Neos\Flow\Security\Authorization\Privilege\PrivilegeSubjectInterface;
use Neos\ContentRepository\Domain\Model\NodeInterface;
/**
* A node privilege subject
*/
class NodePrivilegeSubject implements PrivilegeSubjectInterface
{
/**
* @var NodeInterface
*/
protected $node;
/**
* @var JoinPointInterface
*/
protected $joinPoint;
/**
* @param NodeInterface $node The node we will check privileges for
* @param JoinPointInterface $joinPoint If we intercept node operations, this joinpoint represents the method called on the node and holds a reference to the node we will check privileges for
*/
public function __construct(NodeInterface $node, JoinPointInterface $joinPoint = null)
{
$this->node = $node;
$this->joinPoint = $joinPoint;
}
/**
* @return NodeInterface
*/
public function getNode()
{
return $this->node;
}
/**
* @return JoinPointInterface
*/
public function getJoinPoint()
{
return $this->joinPoint;
}
}