02-28-2017, 09:19 PM
So if your permission levels in are in userspice, you can go into the admin panel and at the top click on permission levels. Each permission level has an id. 1 is regular user. 2 is admin. The others you just add on your own. So in that usersc/scripts/did_not_have_permission.php you can put...
if(hasPerm([1],$user->data->id()){
Redirect::to('here');
}
if(hasPerm([2],$user->data->id()){
Redirect::to('here');
}
You can also put them in as an array, so
if(hasPerm([3,4,5],$user->data->id()){
Redirect::to('here');
}
Finally, you can redirect them with a message
if(hasPerm([2],$user->data->id()){
Redirect::to('account.php?err=Sorry+you+do+not+have+permission!');
}
if(hasPerm([1],$user->data->id()){
Redirect::to('here');
}
if(hasPerm([2],$user->data->id()){
Redirect::to('here');
}
You can also put them in as an array, so
if(hasPerm([3,4,5],$user->data->id()){
Redirect::to('here');
}
Finally, you can redirect them with a message
if(hasPerm([2],$user->data->id()){
Redirect::to('account.php?err=Sorry+you+do+not+have+permission!');
}