require_once('acl_library.php'); if (!require_acl('admin')) { header('Location: /login.php'); //redirect to login page if user doesn't have admin role exit(); } //process admin dashboard page
require_once('acl_library.php'); if (!require_acl('client')) { http_response_code(403); //return 403 forbidden error if user doesn't have client role exit(); } //process API endpointThe package library that implements the require_acl() function could be a custom library developed specifically for your application or a third-party library such as Symfony Security Component or Laravel Authorization.