allow to disable user preferences by permission (#895)

This commit is contained in:
Kevin Papst
2019-07-01 19:37:20 +02:00
committed by GitHub
parent 94d68c8b64
commit 90980f40f5
10 changed files with 58 additions and 21 deletions

View File

@@ -83,13 +83,13 @@ class UserVoter extends AbstractVoter
// used in templates and ProfileController
case self::VIEW:
case self::EDIT:
case self::PREFERENCES:
// always allow the user to edit these own settings
if ($subject->getId() === $user->getId()) {
return true;
}
// no break on purpose
case self::PREFERENCES:
case self::PASSWORD:
case self::API_TOKEN:
case self::ROLES: