Allow account endpoint to be filtered on various fields.

This commit is contained in:
James Cole
2024-08-03 06:00:22 +02:00
parent c8646e20cb
commit b213148ae8
11 changed files with 259 additions and 106 deletions

View File

@@ -25,6 +25,7 @@ namespace FireflyIII\Policies;
use FireflyIII\Models\Account;
use FireflyIII\User;
use Illuminate\Support\Facades\Log;
class AccountPolicy
{
@@ -33,7 +34,7 @@ class AccountPolicy
*/
public function view(User $user, Account $account): bool
{
die('OK');
die('OK1');
return true;
return auth()->check() && $user->id === $account->user_id;
@@ -46,9 +47,7 @@ class AccountPolicy
*/
public function viewAny(): bool
{
die('OK');
return true;
Log::debug(__METHOD__);
return auth()->check();
}