You are here

function domain_form_permission_check in Domain Access 7.3

Same name and namespace in other branches
  1. 7.2 domain.module \domain_form_permission_check()

Check a user's permissions for displaying the Domain form on nodes.

This sets the hierarchy of user form permissions for those without 'set domain access'. Note that the most permissive permission wins.

1 call to domain_form_permission_check()
domain_form_alter in ./domain.module
Implements hook_form_alter().

File

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

Code

function domain_form_permission_check() {
  $perms = array(
    'publish from default domain' => 1,
    'publish from assigned domain' => 2,
    'publish to any assigned domain' => 3,
  );

  // By default, we will hide the form by returning NULL.
  $action = NULL;
  foreach ($perms as $perm => $value) {
    if (user_access($perm)) {
      $action = $value;
    }
  }
  return $action;
}