User-Access return value issue I'm executing the following code in hook_init:

function my_module_init(){
    global $user;

    $apprenticeship = user_access('prevent publishing apprenticeship job', $user);
    drupal_set_message("CHECKING permission[prevent publishing apprenticeship job]: " . $apprenticeship);
    $content = user_access('access content', $user);
    drupal_set_message("CHECKING permission[access content]: " . $content);
}


I am logged in as USER#1 and the prevent publishing apprenticeship job permission is NOT set for user#1.

However, each time my code executes user_access('prevent publishing apprenticeship job', $user) returns 1 i:e true.

As I said, that permission is not set for for the administrator role.

Can anyone help and point out what I'm missing or doing wrong?

PS:

The access content also returns 1 but that is set for the administrator role.
The user #1 is special, in Drupal. It will always have all permissions, even the ones not explicitly set for the administrator role.

See user_access() source code.

  // User #1 has all privileges:
  if ($account-&gt;uid == 1) {
    return TRUE;
  }