You are here

public function CustomAccess::buildAdminForm in Field Permissions 8.2

Same name and namespace in other branches
  1. 8 src/Plugin/FieldPermissionType/CustomAccess.php \Drupal\field_permissions\Plugin\FieldPermissionType\CustomAccess::buildAdminForm()

Build or alter the field admin form.

Parameters

array $form: The form array.

\Drupal\Core\Form\FormStateInterface $form_state: The form state object.

\Drupal\user\RoleStorageInterface $role_storage: The user role storage.

Overrides AdminFormSettingsInterface::buildAdminForm

File

src/Plugin/FieldPermissionType/CustomAccess.php, line 66

Class

CustomAccess
Defines custom access for fields.

Namespace

Drupal\field_permissions\Plugin\FieldPermissionType

Code

public function buildAdminForm(array &$form, FormStateInterface $form_state, RoleStorageInterface $role_storage) {
  $this
    ->addPermissionsGrid($form, $form_state, $role_storage);

  // Only display the permissions matrix if this type is selected.
  $form['#attached']['library'][] = 'field_permissions/field_permissions';
}