mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-26 07:14:35 +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');
|
$config = Config::app()->getSection('global');
|
||||||
$user = $this->Auth()->getUser();
|
$user = $this->Auth()->getUser();
|
||||||
if ($user->getAdditional('backend_type') === 'db') {
|
if ($user->getAdditional('backend_type') === 'db') {
|
||||||
try {
|
if ($user->can('*') || ! $user->can('no-user/password-change')) {
|
||||||
$userBackend = UserBackend::create($user->getAdditional('backend_name'));
|
try {
|
||||||
} catch (ConfigurationError $e) {
|
$userBackend = UserBackend::create($user->getAdditional('backend_name'));
|
||||||
$userBackend = null;
|
} catch (ConfigurationError $e) {
|
||||||
}
|
$userBackend = null;
|
||||||
if ($userBackend !== null) {
|
}
|
||||||
$changePasswordForm = new ChangePasswordForm();
|
if ($userBackend !== null) {
|
||||||
$changePasswordForm
|
$changePasswordForm = new ChangePasswordForm();
|
||||||
->setBackend($userBackend)
|
$changePasswordForm
|
||||||
->handleRequest();
|
->setBackend($userBackend)
|
||||||
$this->view->changePasswordForm = $changePasswordForm;
|
->handleRequest();
|
||||||
|
$this->view->changePasswordForm = $changePasswordForm;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,6 +43,10 @@ class RoleForm extends RepositoryForm
|
|||||||
$view = $this->getView();
|
$view = $this->getView();
|
||||||
|
|
||||||
$this->providedPermissions['application'] = [
|
$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') => [
|
$helper->filterName('application/share/navigation') => [
|
||||||
'name' => 'application/share/navigation',
|
'name' => 'application/share/navigation',
|
||||||
'description' => $this->translate('Allow to share navigation items')
|
'description' => $this->translate('Allow to share navigation items')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user