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;
    }