mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-11 20:31:06 +03:30
fix policies
This commit is contained in:
@@ -2,16 +2,13 @@
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use App\Item;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StoreItemRequest extends FormRequest
|
||||
{
|
||||
public function authorize()
|
||||
{
|
||||
if ($this->method() == 'POST') {
|
||||
return auth('api')->check() && auth('api')->user()->can('store', Item::class);
|
||||
} else {
|
||||
if ($this->method() != 'POST') {
|
||||
$Item = $this->route('Item');
|
||||
return auth('api')->check() && $Item && auth('api')->user()->can('update', $Item);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user