Skip to content
Permalink
Browse files

accesslib:require_capability() revamp to check for USER->access

$USER->capabilities is deprecated.
  • Loading branch information...
martinlanghoff
martinlanghoff committed Sep 19, 2007
1 parent 0d8a77c commit 0c24aa192995f4cb4f9656c22498fa427e2df5c1
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/accesslib.php
@@ -661,7 +661,7 @@ function require_capability($capability, $context=NULL, $userid=NULL, $doanythin
/// If the current user is not logged in, then make sure they are (if needed)
if (empty($userid) and empty($USER->capabilities)) {
if (is_null($userid) && !isset($USER->access)) {
if ($context && ($context->contextlevel == CONTEXT_COURSE)) {
require_login($context->instanceid);
} else if ($context && ($context->contextlevel == CONTEXT_MODULE)) {

0 comments on commit 0c24aa1

Please sign in to comment.
You can’t perform that action at this time.