You are here

function recipe_access in Recipe 6

Same name and namespace in other branches
  1. 5 recipe.module \recipe_access()

Implementation of hook_access().

File

./recipe.module, line 576
recipe.module - share recipes

Code

function recipe_access($op, $node, $account) {
  if ($op == 'create') {
    return user_access('create recipes', $account);
  }
  if ($op == 'update' || $op == 'delete') {
    if (user_access('edit own recipes', $account) && $account->uid == $node->uid || user_access('edit any recipes', $account)) {
      return TRUE;
    }
  }
}