Skip to content

Commit

Permalink
MERGE: Branch '3.3' into 4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
kitsunet committed Jun 16, 2019
2 parents fe4ac1a + ef32e63 commit 6b10a5b
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Configuration/Policy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,27 @@
# Security policy for the ContentRepository package #
# #

privilegeTargets:
'Neos\Flow\Security\Authorization\Privilege\Method\MethodPrivilege':
'Neos.Neos:PublicWorkspaceAccess':
matcher: 'method(Neos\ContentRepository\Domain\Service\Context->validateWorkspace()) && evaluate(this.workspace.publicWorkspace === true)'

'Neos.Neos:OtherWorkspacesAccess':
matcher: 'method(Neos\ContentRepository\Domain\Service\Context->validateWorkspace()) && evaluate(this.workspace.publicWorkspace === false) && evaluate(this.workspace.personalWorkspace === false)'

roles:
'Neos.Flow:Everybody':
privileges:
- privilegeTarget: 'Neos.Neos:PublicWorkspaceAccess'
permission: GRANT

'Neos.ContentRepository:InternalWorkspaceAccess':
abstract: TRUE
privileges:
- privilegeTarget: 'Neos.Neos:OtherWorkspacesAccess'
permission: GRANT

'Neos.ContentRepository:Administrator':
abstract: true
parentRoles: ['Neos.ContentRepository:InternalWorkspaceAccess']

7 changes: 7 additions & 0 deletions Configuration/Testing/Policy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# #
# Security policy for the ContentRepository package #
# #

roles:
'Neos.ContentRepository:TestingAdministrator':
parentRoles: ['Neos.ContentRepository:Administrator']
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ public function attributeFilterIsSupported($filter, array $expectedNodePaths)
*/
public function findByNodeIdentifierReturnsCorrectNodeInContext()
{
$this->authenticateRoles(['Neos.ContentRepository:TestingAdministrator']);
$q = new FlowQuery(array($this->node));
$foundNode = $q->find('#30e893c1-caef-0ca5-b53d-e5699bb8e506')->get(0);
$this->assertSame($this->node->getNode('about-us'), $foundNode);
Expand Down Expand Up @@ -273,6 +274,7 @@ public function findByNodeWithRelativePathReturnsCorrectNode()
*/
public function findByMultipleNodesReturnsMatchingNodesForAllNodes()
{
$this->authenticateRoles(['Neos.ContentRepository:TestingAdministrator']);
$testContext = $this->contextFactory->create(array('workspaceName' => 'test'));
$testNodeA = $testContext->getNode('/sites/example/home/main/dummy44');
$testNodeB = $testContext->getNode('/sites/example/home/main/dummy45');
Expand Down

0 comments on commit 6b10a5b

Please sign in to comment.