You are here

function acl_edit_form in ACL 8

Same name and namespace in other branches
  1. 5 acl.module \acl_edit_form()
  2. 6 acl.module \acl_edit_form()
  3. 7 acl.module \acl_edit_form()

Provide a form to edit the ACL that can be embedded in other forms.

Pass $new_acl=TRUE if you have no ACL yet, but do supply a string like 'my_module_new_acl' as $acl_id anyway; create the ACL and set $form['acl_id'] before calling acl_save_form().

File

./acl.module, line 110
An API module providing by-user access control lists.

Code

function acl_edit_form(FormStateInterface $form_state, $acl_id, $label = NULL, $new_acl = FALSE) {
  module_load_include('inc', 'acl', 'acl.admin');
  $build_info = $form_state
    ->getBuildInfo();
  $build_info['files'][] = [
    'module' => 'acl',
    'type' => 'inc',
    'name' => 'acl.admin',
  ];
  $form_state
    ->setBuildInfo($build_info);
  return _acl_edit_form($acl_id, $label, $new_acl);
}