Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
uw_cfg_common
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_cfg_common
Commits
a3f5a0d6
Commit
a3f5a0d6
authored
3 years ago
by
Liam Morland
Committed by
Kevin Paxman
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
ISTWCMS-4960: Give default access to Webforms that have no access to create submissions
parent
e5e1cee5
No related branches found
No related tags found
1 merge request
!134
ISTWCMS-4960: Use #access to remove parts of forms instead of unsetting them
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
uw_cfg_common.install
+23
-0
23 additions, 0 deletions
uw_cfg_common.install
with
23 additions
and
0 deletions
uw_cfg_common.install
+
23
−
0
View file @
a3f5a0d6
...
...
@@ -428,6 +428,29 @@ function uw_cfg_common_update_8103() {
}
/*
* Give default access to Webforms that have no access to create submissions.
*/
function
uw_cfg_common_update_8104
()
{
$counter
=
0
;
$webforms
=
\Drupal
::
entityTypeManager
()
->
getStorage
(
'webform'
)
->
loadMultiple
();
foreach
(
$webforms
as
$webform
)
{
$access
=
$webform
->
getAccessRules
();
if
(
empty
(
$access
[
'create'
][
'roles'
]))
{
$access
[
'create'
][
'roles'
]
=
[
'anonymous'
,
'authenticated'
,
];
$webform
->
setAccessRules
(
$access
);
$webform
->
save
();
$counter
++
;
}
}
return
t
(
'Set default access for @counter Webforms.'
,
[
'@counter'
=>
$counter
]);
}
/**
* Implements hook_update_dependencies().
*/
...
...
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