Skip to content
Snippets Groups Projects
Commit ebb9efc0 authored by Eric Bremner's avatar Eric Bremner
Browse files

ISTWCMS-7252: Fix the user access check for the forms

parent 3977e13d
No related branches found
No related tags found
No related merge requests found
......@@ -348,14 +348,24 @@ class UwCustomFormsService {
// Get the forms from the config.
$forms = $this->configFactory->getEditable('uw_custom_forms.settings')->get('allowed_forms');
foreach ($forms as $form) {
if ($form) {
$user = $this->entityTypeManager
->getStorage('user')
->load($this->currentUser->id());
if ($this->checkUserAccess($user, $form) instanceof AccessResultAllowed) {
$allowed_forms[] = $form;
// If there are forms, then get the info.
if ($forms) {
// Step through each of the forms, and get the info.
foreach ($forms as $form) {
// If there is a form, get its info.
if ($form) {
// Get the user.
$user = $this->entityTypeManager
->getStorage('user')
->load($this->currentUser->id());
// If the user has access, then add it to the array.
if ($this->checkUserAccess($user, $form) instanceof AccessResultAllowed) {
$allowed_forms[] = $form;
}
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment