diff options
author | Bjoern Schiessle <bjoern@schiessle.org> | 2017-12-01 15:50:29 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2018-02-27 12:29:25 +0100 |
commit | 3285becdc16a9eb57a507e6ad58100d392f2894a (patch) | |
tree | 1c8800777638c6800f2acb8f33beeec0ecaa4dad /lib/private | |
parent | ebb15283a60d1c2ee5fb731feca1c68275d58264 (diff) | |
download | nextcloud-server-3285becdc16a9eb57a507e6ad58100d392f2894a.tar.gz nextcloud-server-3285becdc16a9eb57a507e6ad58100d392f2894a.zip |
fix unit tests
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/Settings/Admin/Sharing.php | 55 |
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() { |