src/Sulu/Component/Security/Authorization/AccessControl/AccessControlManager.php
private function getUserSecurityContextPermissions(
        $locale,
        $securityContext,
        UserInterface $user,
        $checkPermissionType
    ) {
        $userPermissions = [];

        foreach ($user->getUserRoles() as $userRole) {
            $userPermissions = $this->cumulatePermissions(
                $userPermissions,
                $this->getUserRoleSecurityContextPermission(
                    $locale,
                    $securityContext,
                    $userRole,
                    $checkPermissionType
                )
            );
        }

        return $userPermissions;
    }
private function getUserSecurityContextPermissions(
        $locale,
        $securityContext,
        UserInterface $user,
        $checkPermissionType
    ) {
        $userPermissions = [];

        foreach ($user->getUserRoles() as $userRole) {
            $userPermissions = $this->cumulatePermissions(
                $userPermissions,
                $this->getUserRoleSecurityContextPermission(
                    $locale,
                    $securityContext,
                    $userRole,
                    $checkPermissionType
                )
            );
        }

        return $userPermissions;
    }
private function getUserSecurityContextPermissions ( $ locale , $ securityContext , UserInterface $ user , $ checkPermissionType ) { $ userPermissions = [ ] ; foreach ( $ user -> getUserRoles ( ) as $ userRole ) { $ userPermissions = $ this -> cumulatePermissions ( $ userPermissions , $ this -> getUserRoleSecurityContextPermission ( $ locale , $ securityContext , $ userRole , $ checkPermissionType ) ) ; } return $ userPermissions ; }
Returns the permissions for the given security context for the given user.

@param string $locale
@param string $securityContext
@param UserInterface $user The user for which the security is checked
@param bool $checkPermissionType Flag to show if the permission type should also be checked. If set to false
it will only check if the user has access to the context in the given locale

@return array
Returns the permissions for the given security context for the given user .