| @@ -4,29 +4,20 @@ | ||
| 4 | 4 | |
| 5 | 5 | namespace Metricool\Features\UserSettings; |
| 6 | 6 | |
| 7 | 7 | use Metricool\Features\AbstractLoader; |
| 8 | -use Metricool\Services\DashboardService; | |
| 9 | -use Metricool\Support\Helpers\Storages\EnvironmentConfig; | |
| 10 | -use Metricool\Support\Helpers\Storages\RequestStorage; | |
| 8 | +use Metricool\Traits\HasAllowlistControl; | |
| 11 | 9 | |
| 12 | 10 | class UserSettingsLoader extends AbstractLoader |
| 13 | 11 | { |
| 14 | - private DashboardService $dashboard; | |
| 12 | + use HasAllowlistControl; | |
| 15 | 13 | |
| 16 | - public function __construct(EnvironmentConfig $env, RequestStorage $request, DashboardService $dashboard) | |
| 17 | - { | |
| 18 | - parent::__construct($env, $request); | |
| 19 | - | |
| 20 | - $this->dashboard = $dashboard; | |
| 21 | - } | |
| 22 | - | |
| 23 | 14 | /** |
| 24 | 15 | * @inheritDoc |
| 25 | 16 | */ |
| 26 | 17 | public function isEnabled(): bool |
| 27 | 18 | { |
| 28 | - return $this->dashboard->isOnboardingCompleted() && current_user_can('metricool_manage'); | |
| 19 | + return true; | |
| 29 | 20 | } |
| 30 | 21 | |
| 31 | 22 | /** |
| 32 | 23 | * @inheritDoc |
| @@ -32,7 +23,7 @@ | ||
| 32 | 23 | * @inheritDoc |
| 33 | 24 | */ |
| 34 | 25 | public function inScope(): bool |
| 35 | 26 | { |
| 36 | - return true; | |
| 27 | + return $this->userCanManage(); | |
| 37 | 28 | } |
| 38 | 29 | } |