You are here

function scald_invoke_atom_access in Scald: Media Management made easy 7

Invokes the hook_scald_atom_access() and collects the results.

Requires the same parameters as the hook itself.

  • Deny: at least one of the hook implementations denies access.
  • Allow: none denies and at least one of the hook implementations

allows access.

  • Ignore: otherwise.

@codingStandardsIgnoreStart

Parameters

ScaldAtom $atom: A Scald Atom.

string $action: The string with action.

mixed $account: (Optional).

Return value

mixed SCALD_ATOM_ACCESS_ALLOW or SCALD_ATOM_ACCESS_DENY or SCALD_ATOM_ACCESS_IGNORE.

1 call to scald_invoke_atom_access()
scald_action_permitted in ./scald.module
Determines if a given User can act on a given Atom in a given way.

File

./scald.module, line 1012
The Scald Core, which handles all Scald Registries and dispatch.

Code

function scald_invoke_atom_access($atom, $action, $account = NULL) {

  // @codingStandardsIgnoreEnd
  if (user_access('administer scald atoms')) {
    return SCALD_ATOM_ACCESS_ALLOW;
  }
  $access = module_invoke_all('scald_atom_access', $atom, $action, $account);
  if (in_array(SCALD_ATOM_ACCESS_DENY, $access, TRUE)) {
    return SCALD_ATOM_ACCESS_DENY;
  }
  elseif (in_array(SCALD_ATOM_ACCESS_ALLOW, $access, TRUE)) {
    return SCALD_ATOM_ACCESS_ALLOW;
  }
  return SCALD_ATOM_ACCESS_IGNORE;
}