profile super admin

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
2026-04-29 15:20:57 +07:00
co-authored by Copilot
parent 3ad5609c8e
commit e46f91a87a
@@ -23,7 +23,9 @@ class ProfileController extends Controller
*/ */
public function index(Request $request) public function index(Request $request)
{ {
Gate::authorize('fasilitator'); if(!Gate::authorize(['fasilitator', 'super_admin'])) {
abort(403);
}
$user = Auth::user(); $user = Auth::user();
$profile = $user->profile; $profile = $user->profile;
@@ -130,7 +132,7 @@ class ProfileController extends Controller
public function show(string $id): JSONResponse public function show(string $id): JSONResponse
{ {
// attempt to access profile, only for allowed roles // attempt to access profile, only for allowed roles
if (!Gate::any(['petani', 'fasilitator', 'offtaker'])) { if (!Gate::any(['petani', 'fasilitator', 'offtaker', 'super_admin'])) {
abort(403); abort(403);
} }