You are here

function messaging_method_permission in Messaging 6.2

Same name and namespace in other branches
  1. 5 messaging.module \messaging_method_permission()
  2. 6.4 messaging.module \messaging_method_permission()
  3. 6 messaging.module \messaging_method_permission()
  4. 6.3 messaging.module \messaging_method_permission()
  5. 7 messaging.module \messaging_method_permission()

Check permission for method and account

Parameters

$method: Sending method id

$account: User account to check permission

2 calls to messaging_method_permission()
messaging_method_default in ./messaging.module
Returns default messaging method
messaging_method_list in ./messaging.module
List sending methods

File

./messaging.module, line 529

Code

function messaging_method_permission($method, $account = NULL) {
  $info = messaging_method_info($method);

  // This sending method may be disabled
  if (!$info) {
    return FALSE;
  }
  elseif (!empty($info['access'])) {
    return user_access($info['access'], $account);
  }
  else {
    return TRUE;
  }
}