Skip to content

Commit

Permalink
In debug mode, warn people if they are asking for an unknown capability.
Browse files Browse the repository at this point in the history
  • Loading branch information
tjhunt committed Sep 19, 2006
1 parent 8cd402f commit a8a7300
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/accesslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,10 @@ function has_capability($capability, $context=NULL, $userid=NULL, $doanything=tr

global $USER, $CONTEXT, $CFG;

if (debugging() && !record_exists('capabilities', 'name', $capability)) {
debugging("Checking for unknown cabability '$capability' in context {$context->id}.");
}

if (empty($userid) && empty($USER->capabilities)) { // Real user, first time here
if (isloggedin()) {
load_defaultuser_role(); // All users get this by default
Expand Down

0 comments on commit a8a7300

Please sign in to comment.