Code cleanup and better auth check

This commit is contained in:
James Cole 2020-07-12 17:31:11 +02:00
parent e24c2491a6
commit 0c9a25a073
No known key found for this signature in database
GPG Key ID: B5669F9493CDE38D
2 changed files with 1 additions and 3 deletions

View File

@ -42,8 +42,6 @@ use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface;
use FireflyIII\Repositories\Recurring\RecurringRepositoryInterface;
use FireflyIII\Repositories\RuleGroup\RuleGroupRepositoryInterface;
use FireflyIII\Repositories\Tag\TagRepositoryInterface;
use FireflyIII\Repositories\TransactionGroup\TransactionGroupRepository;
use FireflyIII\Repositories\TransactionGroup\TransactionGroupRepositoryInterface;
use FireflyIII\Services\Internal\Destroy\AccountDestroyService;
use FireflyIII\Services\Internal\Destroy\JournalDestroyService;
use Illuminate\Http\JsonResponse;

View File

@ -36,7 +36,7 @@ class DataDestroyRequest extends Request
public function authorize(): bool
{
// Only allow authenticated users
return auth()->check();
return auth()->check() && !auth()->user()->hasRole('demo');
}
/**