chill-bundles/src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelperInterface.php
2021-11-30 13:54:58 +01:00

33 lines
825 B
PHP

<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\MainBundle\Security\Authorization;
use Chill\MainBundle\Entity\Center;
use Chill\MainBundle\Entity\Scope;
use Symfony\Component\Security\Core\User\UserInterface;
interface AuthorizationHelperInterface
{
/**
* Get reachable Centers for the given user, role,
* and optionnaly Scope.
*
* @return Center[]
*/
public function getReachableCenters(UserInterface $user, string $role, ?Scope $scope = null): array;
/**
* @param array|Center|Center[] $center
*/
public function getReachableScopes(UserInterface $user, string $role, $center): array;
}