Documentation

CCourse::IsHaveCourse

bool
CCourse::IsHaveCourse(
 string MIN_PERMISSION = "W"
);

The IsHaveCourse method defines whether a current user has the minimum specified access permission to at least one course.

Parameters

ParameterDescription
MIN_PERMISSION Minimum access permission. "W" (write) by default.

Return Values

The method returns true if a user is entitled to access at least one course, or false otherwise.

See Also

  • CCourse::GetList

    Example

    
    <?
    
    if (CCourse::IsHaveCourse($MIN_PERMISSION = "W"))
    {
      echo "You are a teacher!";
    }
    else
    {
      echo "Access denied!";
    }
    ?>
  • © «Bitrix24», 2001-2024
    Up