Auto commit for release 'develop' on 2024-05-13

This commit is contained in:
github-actions
2024-05-13 05:10:16 +02:00
parent 04fe5d1fc4
commit cb5d856769
48 changed files with 271 additions and 398 deletions

View File

@@ -24,27 +24,18 @@ declare(strict_types=1);
namespace FireflyIII\Policies;
use FireflyIII\Entities\AccountBalance;
use FireflyIII\Models\Account;
use FireflyIII\User;
class AccountBalancePolicy
{
/**
* TODO needs better authentication.
*
* @param User $user
* @param Account $account
*
* @return bool
*/
public function view(User $user, AccountBalance $accountBalance): bool
{
return true;
}
/**
* Everybody can do this, but selection should limit to user.
*
@@ -54,6 +45,4 @@ class AccountBalancePolicy
{
return true;
}
}

View File

@@ -28,23 +28,16 @@ use FireflyIII\User;
class AccountPolicy
{
/**
* TODO needs better authentication.
*
* @param User $user
* @param Account $account
*
* @return bool
*/
public function view(User $user, Account $account): bool
{
return true;
return auth()->check() && $user->id === $account->user_id;
}
/**
* Everybody can do this, but selection should limit to user.
*
@@ -53,6 +46,7 @@ class AccountPolicy
public function viewAny(): bool
{
return true;
return auth()->check();
}

View File

@@ -30,11 +30,6 @@ class BalancePolicy
{
/**
* TODO needs better authentication.
*
* @param User $user
* @param Account $account
*
* @return bool
*/
public function view(User $user, Account $account): bool
{

View File

@@ -23,22 +23,17 @@ declare(strict_types=1);
namespace FireflyIII\Policies;
use FireflyIII\Models\Account;
use FireflyIII\User;
class UserPolicy
{
/**
* TODO needs better authentication.
*
* @param User $user
* @param Account $account
*
* @return bool
*/
public function view(User $user, User $user1): bool
{
return true;
return auth()->check() && $user->id === $account->user_id;
}
@@ -50,11 +45,14 @@ class UserPolicy
public function viewAny(): bool
{
return true;
return auth()->check();
}
public function viewAccounts(User $user): bool
{
return true;
return auth()->check();
}
}