You are here

function _forum_access_container_grants_form in Forum Access 8

Get roles permissions form for container.

1 call to _forum_access_container_grants_form()
forum_access_form_taxonomy_term_forums_container_form_alter in ./forum_access.module
Implements hook_form_FORM_ID_alter() for taxonomy_term_forums_container_form.

File

includes/forum_access.admin.inc, line 245
Contains integrations with forms.

Code

function _forum_access_container_grants_form($form_state, $settings) {
  $roles = user_roles();
  $administer_forums_roles = user_roles(FALSE, 'administer forums');
  $bypass_node_access_roles = user_roles(FALSE, 'bypass node access');
  $vid = \Drupal::config('forum.settings')
    ->get('vocabulary');
  $vocabulary = Vocabulary::load($vid);
  $cols = [
    'view' => t('View this container'),
    'create' => t('See this container in the forums selection list'),
  ];
  _forum_access_grants_form_elements($form, $roles, $administer_forums_roles, $bypass_node_access_roles, $cols, $settings);
  $form['info'] = [
    '#type' => 'item',
    '#description' => t('Users who can see any forum or container within this one should get the <strong><em>View</em></strong> grant. <br />
      Users who can post to a forum within this container should get the <strong><em>See</em></strong> grant, so that the forum appears in the proper context in the %Forums selection list.', [
      '%Forums' => $vocabulary
        ->label(),
    ]),
  ];
  return $form;
}