diff --git a/app/Http/Controllers/Api/ProfileController.php b/app/Http/Controllers/Api/ProfileController.php index 2d21ae5..696b1dd 100644 --- a/app/Http/Controllers/Api/ProfileController.php +++ b/app/Http/Controllers/Api/ProfileController.php @@ -23,7 +23,9 @@ class ProfileController extends Controller */ public function index(Request $request) { - Gate::authorize('fasilitator'); + if(!Gate::authorize(['fasilitator', 'super_admin'])) { + abort(403); + } $user = Auth::user(); $profile = $user->profile; @@ -130,7 +132,7 @@ class ProfileController extends Controller public function show(string $id): JSONResponse { // attempt to access profile, only for allowed roles - if (!Gate::any(['petani', 'fasilitator', 'offtaker'])) { + if (!Gate::any(['petani', 'fasilitator', 'offtaker', 'super_admin'])) { abort(403); }