diff --git a/uw_cfg_common.module b/uw_cfg_common.module index ed72eb93a6fd1ed14148f0a984c4ec27a48ea44c..60585146cebc5190297588111d4eba8a7712c472 100644 --- a/uw_cfg_common.module +++ b/uw_cfg_common.module @@ -1033,11 +1033,8 @@ function uw_cfg_common_webform_access(WebformInterface $webform, string $operati // admin/structure/webform/manage/WEBFORM_ID/access. $create_user_ids = $webform->getAccessRules()['create']['users']; - // Get current logged in user id. - $current_user_id = \Drupal::currentUser()->id(); - - // If the logged user is in not a specified user, get access denied. - if (!in_array($current_user_id, $create_user_ids)) { + // If the logged in user is not a specified user, get access denied. + if (!in_array($account->id(), $create_user_ids)) { return AccessResult::forbidden(); } break;