From f6578b74f43f5ef860c1850bc6c4c176d80135f5 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Thu, 20 Aug 2020 09:00:03 +0200 Subject: [PATCH] Allow using geolocation in the dashboard Else the weather geolocation is kind of useless. Signed-off-by: Roeland Jago Douma --- apps/dashboard/lib/Controller/DashboardController.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/dashboard/lib/Controller/DashboardController.php b/apps/dashboard/lib/Controller/DashboardController.php index 40ed026b82b..8f845ca9b6a 100644 --- a/apps/dashboard/lib/Controller/DashboardController.php +++ b/apps/dashboard/lib/Controller/DashboardController.php @@ -111,7 +111,14 @@ class DashboardController extends Controller { $this->inititalStateService->provideInitialState('dashboard', 'version', $this->config->getUserValue($this->userId, 'dashboard', 'backgroundVersion', 0)); $this->config->setUserValue($this->userId, 'dashboard', 'firstRun', '0'); - return new TemplateResponse('dashboard', 'index'); + $response = new TemplateResponse('dashboard', 'index'); + + // For the weather widget we should allow the geolocation + $featurePolicy = new Http\FeaturePolicy(); + $featurePolicy->addAllowedGeoLocationDomain('\'self\''); + $response->setFeaturePolicy($featurePolicy); + + return $response; } /** -- 2.39.5