mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-04-08 17:15:08 +02:00
Merge pull request #4015 from Icinga/feature/no-user-password-changes-3286
New permission `no-user/password-change`
This commit is contained in:
commit
51b05ce39a
@ -43,17 +43,19 @@ class AccountController extends Controller
|
||||
$config = Config::app()->getSection('global');
|
||||
$user = $this->Auth()->getUser();
|
||||
if ($user->getAdditional('backend_type') === 'db') {
|
||||
try {
|
||||
$userBackend = UserBackend::create($user->getAdditional('backend_name'));
|
||||
} catch (ConfigurationError $e) {
|
||||
$userBackend = null;
|
||||
}
|
||||
if ($userBackend !== null) {
|
||||
$changePasswordForm = new ChangePasswordForm();
|
||||
$changePasswordForm
|
||||
->setBackend($userBackend)
|
||||
->handleRequest();
|
||||
$this->view->changePasswordForm = $changePasswordForm;
|
||||
if ($user->can('*') || ! $user->can('no-user/password-change')) {
|
||||
try {
|
||||
$userBackend = UserBackend::create($user->getAdditional('backend_name'));
|
||||
} catch (ConfigurationError $e) {
|
||||
$userBackend = null;
|
||||
}
|
||||
if ($userBackend !== null) {
|
||||
$changePasswordForm = new ChangePasswordForm();
|
||||
$changePasswordForm
|
||||
->setBackend($userBackend)
|
||||
->handleRequest();
|
||||
$this->view->changePasswordForm = $changePasswordForm;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -43,6 +43,10 @@ class RoleForm extends RepositoryForm
|
||||
$view = $this->getView();
|
||||
|
||||
$this->providedPermissions['application'] = [
|
||||
$helper->filterName('no-user/password-change') => [
|
||||
'name' => 'no-user/password-change',
|
||||
'description' => $this->translate('Prohibit password changes in the account preferences')
|
||||
],
|
||||
$helper->filterName('application/share/navigation') => [
|
||||
'name' => 'application/share/navigation',
|
||||
'description' => $this->translate('Allow to share navigation items')
|
||||
|
Loading…
x
Reference in New Issue
Block a user