From 662dff046d7b287c380656a3c0302cd63736e753 Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Fri, 18 Nov 2016 10:20:04 +0100 Subject: [PATCH] Adjust permission checks Signed-off-by: Lukas Reschke --- settings/Controller/UsersController.php | 14 ++++---------- settings/templates/personal.php | 12 ++++++------ 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/settings/Controller/UsersController.php b/settings/Controller/UsersController.php index 41f3bac733d..fa97845dfba 100644 --- a/settings/Controller/UsersController.php +++ b/settings/Controller/UsersController.php @@ -502,8 +502,6 @@ class UsersController extends Controller { } /** - * @todo add method description - * * @NoAdminRequired * @NoSubadminRequired * @PasswordConfirmationRequired @@ -673,6 +671,8 @@ class UsersController extends Controller { * @PasswordConfirmationRequired * @todo merge into saveUserSettings * + * @NoAdminRequired + * * @param string $username * @param string $displayName * @return DataResponse @@ -681,14 +681,8 @@ class UsersController extends Controller { $currentUser = $this->userSession->getUser(); $user = $this->userManager->get($username); - if ($user === null || - !$user->canChangeDisplayName() || - ( - !$this->groupManager->isAdmin($currentUser->getUID()) && - !$this->groupManager->getSubAdmin()->isUserAccessible($currentUser, $user) && - $currentUser->getUID() !== $username - - ) + if (!$this->groupManager->isAdmin($currentUser->getUID()) && + !$this->groupManager->getSubAdmin()->isUserAccessible($currentUser, $user) ) { return new DataResponse([ 'status' => 'error', diff --git a/settings/templates/personal.php b/settings/templates/personal.php index 519ffa273d9..f5050ab190e 100644 --- a/settings/templates/personal.php +++ b/settings/templates/personal.php @@ -114,7 +114,7 @@ if($_['displayNameChangeSupported']) {

- +

t('Password'));?>
- + - + - +