PaymentPolicy.php 646 B

1234567891011121314151617181920212223
  1. <?php
  2. // Copyright 2019 Hackware SpA <human@hackware.cl>
  3. // This file is part of "Hackware Web Services Payment" and licensed under
  4. // the terms of the GNU Affero General Public License version 3, or (at your
  5. // option) a later version. You should have received a copy of this license
  6. // along with the software. If not, see <https://www.gnu.org/licenses/>.
  7. namespace Hawese\Payment\Policies;
  8. use Hawese\Core\User;
  9. use Hawese\Payment\Payment;
  10. class PaymentPolicy
  11. {
  12. /**
  13. * A user can only read its own payments.
  14. */
  15. public function read(User $user, Payment $payment): bool
  16. {
  17. return $payment->isOwner($user);
  18. }
  19. }