mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-08 20:22:42 +01:00
Fixed wrong overrides, added some more docblocks
This commit is contained in:
parent
71ab4dc3d8
commit
33badc78b7
@ -227,11 +227,11 @@ class PaymentRepository extends BaseRepository
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Payment $payment
|
||||
* @param $payment
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function delete(Payment $payment)
|
||||
public function delete($payment)
|
||||
{
|
||||
if ($payment->invoice->is_deleted) {
|
||||
return false;
|
||||
@ -241,11 +241,11 @@ class PaymentRepository extends BaseRepository
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Payment $payment
|
||||
* @param $payment
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function restore(Payment $payment)
|
||||
public function restore($payment)
|
||||
{
|
||||
if ($payment->invoice->is_deleted) {
|
||||
return false;
|
||||
|
@ -22,11 +22,11 @@ class DocumentPolicy extends EntityPolicy
|
||||
|
||||
/**
|
||||
* @param User $user
|
||||
* @param Document $document
|
||||
* @param $item
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function view(User $user, Document $document)
|
||||
public static function view(User $user, $item)
|
||||
{
|
||||
if ($user->hasPermission('view_all')) {
|
||||
return true;
|
||||
|
@ -2,4 +2,10 @@
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
class InvoicePolicy extends EntityPolicy {}
|
||||
/**
|
||||
* Class InvoicePolicy
|
||||
*/
|
||||
class InvoicePolicy extends EntityPolicy
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -2,4 +2,10 @@
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
class PaymentPolicy extends EntityPolicy {}
|
||||
/**
|
||||
* Class PaymentPolicy
|
||||
*/
|
||||
class PaymentPolicy extends EntityPolicy
|
||||
{
|
||||
|
||||
}
|
@ -2,12 +2,28 @@
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use App\Models\User;
|
||||
|
||||
/**
|
||||
* Class TokenPolicy
|
||||
*/
|
||||
class TokenPolicy extends EntityPolicy {
|
||||
public static function edit($user, $item) {
|
||||
/**
|
||||
* @param User $user
|
||||
* @param $item
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function edit(User $user, $item) {
|
||||
return $user->hasPermission('admin');
|
||||
}
|
||||
|
||||
public static function create($user) {
|
||||
/**
|
||||
* @param User $user
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function create(User $user) {
|
||||
return $user->hasPermission('admin');
|
||||
}
|
||||
}
|
@ -4,10 +4,14 @@ namespace App\Policies;
|
||||
|
||||
use App\Models\User;
|
||||
|
||||
/**
|
||||
* Class VendorPolicy
|
||||
*/
|
||||
class VendorPolicy extends EntityPolicy
|
||||
{
|
||||
/**
|
||||
* @param User $user
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function create(User $user) {
|
||||
|
Loading…
Reference in New Issue
Block a user