Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
uw_custom_forms
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
WCMS
uw_custom_forms
Commits
ebb9efc0
Commit
ebb9efc0
authored
4 days ago
by
Eric Bremner
Browse files
Options
Downloads
Patches
Plain Diff
ISTWCMS-7252: Fix the user access check for the forms
parent
3977e13d
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Service/UwCustomFormsService.php
+18
-8
18 additions, 8 deletions
src/Service/UwCustomFormsService.php
with
18 additions
and
8 deletions
src/Service/UwCustomFormsService.php
+
18
−
8
View file @
ebb9efc0
...
...
@@ -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
;
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment