Skip to content

Commit cfdb198

Browse files
committed
Applied coding standards
1 parent fe7a060 commit cfdb198

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ before starting to add changes. Use example [placed in the end of the page](#exa
1111

1212
## [Unreleased]
1313

14+
- [PR-224](https://github.com/OS2Forms/os2forms/pull/224)
15+
- Add permission for accessing actions and bulk operations in webform submission list
1416
- [PR-101](https://github.com/OS2Forms/os2forms/pull/101)
1517
- Added support for `os2web_key` in Digital post
1618
- Switched from saving settings in key value store to config, i.e
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
'access webform submission list bulk operations and actions':
22
title: 'Access webform submission list bulk operations and actions'
33
description: 'Access webform submission list bulk operations and actions'
4-

modules/os2forms_webform_list/src/CustomWebformSubmissionListBuilder.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,13 @@ protected function buildEntityList(): array {
6060
return $build;
6161
}
6262

63+
64+
/**
65+
* Add permissions check on operations.
66+
*
67+
* @return array
68+
* A renderable array containing the entity list.
69+
*/
6370
public function getDefaultOperations(EntityInterface $entity): array {
6471
if ($this->currentUser->hasPermission('access webform submission list bulk operations and actions')) {
6572
return parent::getDefaultOperations($entity);
@@ -69,7 +76,7 @@ public function getDefaultOperations(EntityInterface $entity): array {
6976
$operations = [];
7077

7178
if ($entity->access('view')) {
72-
$operations[ 'view' ] = [
79+
$operations['view'] = [
7380
'title' => $this->t('View'),
7481
'weight' => 20,
7582
'url' => $this->requestHandler->getUrl($entity, $this->sourceEntity, 'webform.user.submission'),
@@ -80,7 +87,7 @@ public function getDefaultOperations(EntityInterface $entity): array {
8087
&& $this->currentUser->hasPermission('access webform submission log')
8188
&& $webform->hasSubmissionLog()
8289
&& $this->moduleHandler->moduleExists('webform_submission_log')) {
83-
$operations[ 'log' ] = [
90+
$operations['log'] = [
8491
'title' => $this->t('Log'),
8592
'weight' => 100,
8693
'url' => $this->requestHandler->getUrl($entity, $this->sourceEntity, 'webform_submission.log'),
@@ -90,4 +97,5 @@ public function getDefaultOperations(EntityInterface $entity): array {
9097
return $operations;
9198
}
9299
}
100+
93101
}

0 commit comments

Comments
 (0)