- 🇩🇪Germany IT-Cru Munich
I'm not using the url_alias_permissions module, but for me I found out it could work also with implementation of hook_field_widget_WIDGET_TYPE_form_alter() for path widget type. Maybe this could also be used in url_alias_permissions module to simplify it a little bit more.
/** * Implements hook_field_widget_WIDGET_TYPE_form_alter() for path widget. * * Only SEO and Administrator users could manually edit URL aliases * on news_article nodes. */ function custom_module_field_widget_path_form_alter(&$element, FormStateInterface $form_state, $context) { if ($context['items']->getEntity()->bundle() == 'news_article') { $currentUser = \Drupal::currentUser(); if ($currentUser->id() === 1) { return; } if (!array_intersect(['seo', 'administrator'], $currentUser->getRoles())) { $element['pathauto']['#disabled'] = TRUE; $element['alias']['#disabled'] = TRUE; } } }
- First commit to issue fork.
- last update
over 1 year ago 5 pass - @jeroent opened merge request.
- last update
over 1 year ago 5 pass - last update
over 1 year ago 5 pass - last update
over 1 year ago 5 pass - last update
over 1 year ago 5 pass - last update
over 1 year ago 5 pass - Status changed to Fixed
over 1 year ago 8:25am 17 July 2023 - 🇧🇪Belgium JeroenT 🇧🇪
In Drupal 9.4 the permission create and edit url aliases was added, which broke this module.
I moved all logic to a hook_entity_field_access() hook and this module should work again correctly. - 🇮🇳India ayush.pandey
For the module URL Alias Permissions with version: 8.x-1.4, and the issue seems to be resolved by the patch https://www.drupal.org/files/issues/2022-11-15/3313956-4.patch → .
Before patch →
After patch → Automatically closed - issue fixed for 2 weeks with no activity.