|
@@ -3,6 +3,7 @@
|
|
|
namespace App\Http\Requests;
|
|
namespace App\Http\Requests;
|
|
|
|
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
|
+use Illuminate\Support\Facades\Session;
|
|
|
|
|
|
|
|
class SaveProductRequest extends FormRequest
|
|
class SaveProductRequest extends FormRequest
|
|
|
{
|
|
{
|
|
@@ -13,7 +14,8 @@ class SaveProductRequest extends FormRequest
|
|
|
*/
|
|
*/
|
|
|
public function authorize()
|
|
public function authorize()
|
|
|
{
|
|
{
|
|
|
- return true; // todo just admin can save it
|
|
|
|
|
|
|
+ return (Session::get('user')['role'] == 1) ? true : false;
|
|
|
|
|
+// return true; // todo just admin can save it
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|