You are here

function CourseObjectNodeFulfillment::revoke in Course 7.2

Revoke access to the external course object.

For example, removing a user to an access control list.

Overrides CourseObjectFulfillment::revoke

1 call to CourseObjectNodeFulfillment::revoke()
CourseObjectNodeFulfillment::delete in includes/CourseObjectNodeFulfillment.inc
Revoke content access before the fulfillment is deleted.

File

includes/CourseObjectNodeFulfillment.inc, line 33

Class

CourseObjectNodeFulfillment
Course object node fulfillment.

Code

function revoke() {
  if ($this
    ->getCourseObject()
    ->hasNodePrivacySupport()) {
    if ($this
      ->getCourseObject()
      ->getOption('private')) {
      $node = $this
        ->getCourseObject()
        ->getNode();
      module_load_include('inc', 'content_access', 'content_access.admin');
      $acl_id = content_access_get_acl_id($node, 'view');
      acl_remove_user($acl_id, $this->uid);
      node_access_acquire_grants($node);
    }
  }
}