Check user role on store project (has to be admin)

This commit is contained in:
Jérémy Munsch 2021-05-18 19:25:40 +02:00
parent ff5984d227
commit 39dfb703f4
2 changed files with 2 additions and 2 deletions

View file

@ -13,7 +13,8 @@ class StoreProject extends FormRequest
*/
public function authorize()
{
return auth()->check();
return auth()->check() and
auth()->user()->role === 1;
}
/**

View file

@ -2,7 +2,6 @@
namespace App\Http\Requests;
class UpdateProject extends StoreProject
{
}