1
0
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:
Holger Lösken 2016-07-14 23:20:16 +02:00
parent 71ab4dc3d8
commit 33badc78b7
6 changed files with 42 additions and 10 deletions

View File

@ -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;

View File

@ -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;

View File

@ -2,4 +2,10 @@
namespace App\Policies;
class InvoicePolicy extends EntityPolicy {}
/**
* Class InvoicePolicy
*/
class InvoicePolicy extends EntityPolicy
{
}

View File

@ -2,4 +2,10 @@
namespace App\Policies;
class PaymentPolicy extends EntityPolicy {}
/**
* Class PaymentPolicy
*/
class PaymentPolicy extends EntityPolicy
{
}

View File

@ -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');
}
}

View File

@ -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) {