summaryrefslogtreecommitdiffstats
path: root/lib/private/Settings/Admin/Sharing.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Settings/Admin/Sharing.php')
-rw-r--r--lib/private/Settings/Admin/Sharing.php55
1 files changed, 31 insertions, 24 deletions
diff --git a/lib/private/Settings/Admin/Sharing.php b/lib/private/Settings/Admin/Sharing.php
index 7b60efdc67b..dfc0b11478b 100644
--- a/lib/private/Settings/Admin/Sharing.php
+++ b/lib/private/Settings/Admin/Sharing.php
@@ -57,29 +57,6 @@ class Sharing implements ISettings {
$excludeGroupsList = !is_null(json_decode($excludedGroups))
? implode('|', json_decode($excludedGroups, true)) : '';
- $permList = [
- [
- 'id' => 'cancreate',
- 'label' => $this->l->t('Create'),
- 'value' => Constants::PERMISSION_CREATE
- ],
- [
- 'id' => 'canupdate',
- 'label' => $this->l->t('Change'),
- 'value' => Constants::PERMISSION_UPDATE
- ],
- [
- 'id' => 'candelete',
- 'label' => $this->l->t('Delete'),
- 'value' => Constants::PERMISSION_DELETE
- ],
- [
- 'id' => 'canshare',
- 'label' => $this->l->t('Share'),
- 'value' => Constants::PERMISSION_SHARE
- ],
- ];
-
$parameters = [
// Built-In Sharing
'allowGroupSharing' => $this->config->getAppValue('core', 'shareapi_allow_group_sharing', 'yes'),
@@ -98,13 +75,43 @@ class Sharing implements ISettings {
'publicShareDisclaimerText' => $this->config->getAppValue('core', 'shareapi_public_link_disclaimertext', null),
'enableLinkPasswordByDefault' => $this->config->getAppValue('core', 'shareapi_enable_link_password_by_default', 'no'),
'shareApiDefaultPermissions' => $this->config->getAppValue('core', 'shareapi_default_permissions', Constants::PERMISSION_ALL),
- 'shareApiDefaultPermissionsCheckboxes' => $permList,
+ 'shareApiDefaultPermissionsCheckboxes' => $this->getSharePermissionList(),
];
return new TemplateResponse('settings', 'settings/admin/sharing', $parameters, '');
}
/**
+ * get share permission list for template
+ *
+ * @return array
+ */
+ private function getSharePermissionList() {
+ return [
+ [
+ 'id' => 'cancreate',
+ 'label' => $this->l->t('Create'),
+ 'value' => Constants::PERMISSION_CREATE
+ ],
+ [
+ 'id' => 'canupdate',
+ 'label' => $this->l->t('Change'),
+ 'value' => Constants::PERMISSION_UPDATE
+ ],
+ [
+ 'id' => 'candelete',
+ 'label' => $this->l->t('Delete'),
+ 'value' => Constants::PERMISSION_DELETE
+ ],
+ [
+ 'id' => 'canshare',
+ 'label' => $this->l->t('Share'),
+ 'value' => Constants::PERMISSION_SHARE
+ ],
+ ];
+ }
+
+ /**
* @return string the section ID, e.g. 'sharing'
*/
public function getSection() {