vendor/pimcore/portal-engine/src/Service/Security/Authentication/User/PasswordChangeableService.php line 50
* Pimcore Open Core License (POCL)* Full copyright and license information is available in* LICENSE.md which is distributed with this source code.** @copyright Copyright (c) Pimcore GmbH (https://www.pimcore.com)* @license Pimcore Open Core License (POCL)*/namespace Pimcore\Bundle\PortalEngineBundle\Service\Security\Authentication\User;use Pimcore\Bundle\PortalEngineBundle\Enum\Permission;use Pimcore\Bundle\PortalEngineBundle\Event\Auth\LoginPasswordChangeableEvent;use Pimcore\Bundle\PortalEngineBundle\Service\Security\PermissionService;use Pimcore\Bundle\PortalEngineBundle\Service\Security\SecurityService;use Symfony\Component\EventDispatcher\EventDispatcherInterface;/*** @internal*/class PasswordChangeableService{public function __construct(private readonly EventDispatcherInterface $eventDispatcher,private readonly SecurityService $securityService,private readonly PermissionService $permissionService) {}public function isPasswordChangeable(): bool{$event = new LoginPasswordChangeableEvent();if ($portalUser = $this->securityService->getPortalUser()) {$event->setPasswordChangeable($this->permissionService->isAllowed($portalUser, Permission::PASSWORD_CHANGE));}$this->eventDispatcher->dispatch($event);return $event->getPasswordChangeable();}}