You are here

function scald_action_permitted in Scald: Media Management made easy 6

Same name and namespace in other branches
  1. 7 scald.module \scald_action_permitted()

Determines if a given User can act on a given Atom in a given way.

@@@TODO: Implement an optional batch mode which takes an array of Scald Actions.

Parameters

$atom: A Scald Atom

$action: A Scald Action slug

$account: A Drupal user account Defaults to the current $user

Return value

TRUE/FALSE

3 calls to scald_action_permitted()
scald_fetch in ./scald.module
Load a Scald Atom.
scald_render in ./scald.module
Render a Scald Atom
theme_mee_formatter_default in mee/mee.module

File

./scald.module, line 2067

Code

function scald_action_permitted($atom, $action = 'fetch', $account = NULL) {
  $scald_config = variable_get('scald_config', 0);
  if (empty($scald_config->actions[$action])) {
    return FALSE;
  }
  return (bool) (scald_actions($atom, $account) & $scald_config->actions[$action]['mask']);
}