Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Merge branch 'api' into develop
James Cole7d9f22d3f4f1
diff --cc app/JsonApi/V3/Accounts/AccountResource.phpindex a289f9a39a,5448e803de..51cd94db43--- a/app/JsonApi/V3/Accounts/AccountResource.php+++ b/app/JsonApi/V3/Accounts/AccountResource.php@@@ -2,13 -2,31 +2,14 @@@namespace FireflyIII\JsonApi\V3\Accounts;+use FireflyIII\Models\Account;use Illuminate\Http\Request;+ use Illuminate\Support\Collection;use LaravelJsonApi\Core\Resources\JsonApiResource;+/**+ * @property Account $resource+ */class AccountResource extends JsonApiResource{@@@ -43,8 -159,8 +132,9 @@@public function relationships($request): iterable{return [- 'user' => $this->relation('user')+ $this->relation('user')->withData($this->resource->user),+ $this->relation('balances')->withData($this->resource->balances),];}+}diff --cc app/Policies/AccountPolicy.phpindex d0394bfce6,020a285470..3f7b05fa2f--- a/app/Policies/AccountPolicy.php+++ b/app/Policies/AccountPolicy.php@@@ -50,7 -49,21 +50,22 @@@ class AccountPolic*/public function viewAny(): bool{+ return true;return auth()->check();}++ /**+ * Everybody can do this, but selection should limit to user.+ *+ * @return true+ */+ public function viewUser(User $user, Account $account): bool+ {+ return $this->view($user, $account);+ }++ public function viewBalances(User $user, Account $account): bool+ {+ return $this->view($user, $account);+ }}