Skip to content
Snippets Groups Projects

ISTWCMS-5863 Authenticated webforms should properly enforce individual user access

+ 2
5
@@ -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;
Loading