mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-13 22:11:07 +03:30
fix policies
This commit is contained in:
@@ -8,7 +8,9 @@ class StoreItemRequest extends FormRequest
|
|||||||
{
|
{
|
||||||
public function authorize()
|
public function authorize()
|
||||||
{
|
{
|
||||||
if ($this->method() != 'POST') {
|
if ($this->method() == 'POST') {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
$Item = $this->route('Item');
|
$Item = $this->route('Item');
|
||||||
return auth('api')->check() && $Item && auth('api')->user()->can('update', $Item);
|
return auth('api')->check() && $Item && auth('api')->user()->can('update', $Item);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,9 @@ class StorePackageRequest extends FormRequest
|
|||||||
{
|
{
|
||||||
public function authorize()
|
public function authorize()
|
||||||
{
|
{
|
||||||
if ($this->method() != 'POST') {
|
if ($this->method() == 'POST') {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
$Package = $this->route('Package');
|
$Package = $this->route('Package');
|
||||||
return auth('api')->check() && $Package && auth('api')->user()->can('update', $Package);
|
return auth('api')->check() && $Package && auth('api')->user()->can('update', $Package);
|
||||||
}
|
}
|
||||||
@@ -34,6 +36,7 @@ class StorePackageRequest extends FormRequest
|
|||||||
'items' => 'required',
|
'items' => 'required',
|
||||||
];
|
];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user