@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user