You are here

function hook_shs_add_term_access in Simple hierarchical select 7

Alter permissions to create new terms using shs on a per-term level.

Parameters

int $vid: ID of vocabulary to create the term in.

int $parent: ID of parent term (0 for top level).

string $field: Name of field requesting the term list (DOM element name).

object $account: The user to check access for.

Return value

bool <code>FALSE</code> if no new terms should be created below the given parent, otherwise <code>TRUE</code>.

2 invocations of hook_shs_add_term_access()
shs_add_term_access in ./shs.module
Return access to create new terms.
shs_field_widget_form in ./shs.module
Implements hook_field_widget_form().

File

./shs.api.php, line 43
Hooks for the shs module.

Code

function hook_shs_add_term_access($vid, $parent, $field, $account) {

  // Deny creating new terms on tid 0 and 3.
  if ($parent == 0 || $parent == 3) {
    return FALSE;
  }
  return TRUE;
}