public function GNodeBypassAccessTests::testOutsiderBypassGroupAccess in Group 7
Test outsider user's access to nodes in a group when granted bypass group access.
File
- modules/
gnode/ tests/ gnode.test, line 988 - Tests for the gnode module.
Class
- GNodeBypassAccessTests
- Test for bypass access control.
Code
public function testOutsiderBypassGroupAccess() {
$group_type = $this
->createGroupType('example');
$group = $this
->createGroup('example', 'example');
$node = $this
->createNodeInGroup($group->gid);
$web_user = $this
->drupalCreateUser(array(
'access content',
'bypass group access',
));
$this
->drupalLogin($web_user);
$this
->assertNodeOperationAccess($node->nid, 'view', 200, 'Group node is accessible by outsider with bypass group access user permissions');
$this
->assertNodeOperationAccess($node->nid, 'edit', 200, 'Group node is editable by outsider with bypass group access user permissions');
$this
->assertNodeOperationAccess($node->nid, 'delete', 200, 'Group node is deletable by outsider with bypass group access user permissions');
$this
->removeNodeFromGroup($node);
$this
->assertNodeOperationAccess($node->nid, 'view', 200, 'Node not in group is accessible by outsider with bypass group access permission');
$this
->assertNodeOperationAccess($node->nid, 'edit', 403, 'Node not in group is not editable by outsider with bypass group access permission');
$this
->assertNodeOperationAccess($node->nid, 'delete', 403, 'Node not in group is not deletable by outsider with bypass group access permission');
}