You are here

function domain_node_access_create in Domain Access 7.3

Checks if a user can create content of a specific type on the current domain.

See also

domain_node_access().

File

./domain.module, line 2314
Core module functions for the Domain Access suite.

Code

function domain_node_access_create($type, $node, $op, $account) {
  domain_user_set($account);
  $_domain = domain_get_domain();
  if (!isset($account->domain_user[$_domain['domain_id']])) {
    return NODE_ACCESS_IGNORE;
  }

  // Build the permission string.
  $permission = "{$op} {$type} content on assigned domains";

  // Run the access check.
  if (user_access($permission, $account)) {
    return NODE_ACCESS_ALLOW;
  }
  return NODE_ACCESS_IGNORE;
}