You are here

function isNodeEditForm in Permissions by Term 8.2

Same name and namespace in other branches
  1. 8 permissions_by_term.module \isNodeEditForm()
1 call to isNodeEditForm()
permissions_by_term_form_alter in ./permissions_by_term.module
Implements hook_form_alter().

File

./permissions_by_term.module, line 366
Allows access to terms in a vocabulary to be limited by user or role.

Code

function isNodeEditForm() {
  $currentPath = \Drupal::service('path.current')
    ->getPath();
  if (is_numeric(strpos($currentPath, '/node/')) && (is_numeric(strpos($currentPath, '/edit')) || is_numeric(strpos($currentPath, '/add')))) {
    return TRUE;
  }
  return FALSE;
}