You are here

class oa_sectionsNodePrivateAccess in Open Atrium Core 7.2

@file Tests permission inheritance for oa_subspaces

Hierarchy

Expanded class hierarchy of oa_sectionsNodePrivateAccess

File

modules/oa_sections/tests/oa_sectionsNodePrivateAccess.test, line 8
Tests permission inheritance for oa_subspaces

View source
class oa_sectionsNodePrivateAccess extends oa_sectionsNodeAccessBase {
  static function getInfo() {
    return array(
      'name' => 'OA Section Private Node Access test (slow)',
      'description' => 'Test that can access section nodes in a private space correctly',
      'group' => 'OA - Sections',
    );
  }
  function test_oa_sectionsPrivateAccess() {
    extract($this
      ->createOaSpaceAndUsers());
    $team = $this
      ->createNodeInOaSpace($space, array(
      'type' => 'oa_team',
      'uid' => $space_admin->uid,
      'field_oa_team_users' => array(
        LANGUAGE_NONE => array(
          array(
            'target_id' => $space_member->uid,
          ),
          array(
            'target_id' => $space_admin->uid,
          ),
        ),
      ),
    ));
    $space_member_2 = $this
      ->createUserInOaSpace($space);
    $non_member = $this
      ->drupalCreateUser();

    // Group that just $space_member is part of.
    $group = $this
      ->drupalCreateNode(array(
      'type' => 'oa_group',
    ));
    og_group('node', $group, array(
      'entity' => $space_member,
    ));

    // Test a private space.
    $space_private = $this
      ->drupalCreateNode(array(
      'type' => 'oa_space',
      'uid' => $space_admin->uid,
      'group_access' => array(
        LANGUAGE_NONE => array(
          array(
            'value' => 1,
          ),
        ),
      ),
    ));
    og_group('node', $space_private, array(
      'entity' => $space_member,
    ));
    og_group('node', $space_private, array(
      'entity' => $space_member_2,
    ));
    $this
      ->oaTestOaSectionAccess('a private space', $space_private, $space_admin, $space_member, $space_member_2, $non_member, $group);
  }

}

Members