You are here

public function CourseObjectAccess::take in Course 7.2

Same name and namespace in other branches
  1. 6 includes/course.core.inc \CourseObjectAccess::take()
  2. 7 includes/CourseObjectAccess.inc \CourseObjectAccess::take()

Can the user take the object?

Parameters

type $account:

Return value

boolean

3 methods override CourseObjectAccess::take()
CourseObjectAccessConditional::take in plugins/course_object_access/conditional.inc
Can the user take the object?
CourseObjectAccessGrade::take in plugins/course_object_access/grade.inc
Can the user take the object?
CourseObjectAccessTiming::take in plugins/course_object_access/timing.inc
Can the user take the object?

File

includes/CourseObjectAccess.inc, line 49

Class

CourseObjectAccess
Access handler for CourseObjects.

Code

public function take($account) {

  // Block access if conditions evaluate.
  $alter = $this
    ->getOption('alter');
  if ($this
    ->evaluate($account) xor !empty($alter['negate'])) {
    if ($alter['access']) {
      return FALSE;
    }
  }
  return TRUE;
}