Gates - ml-archive/admin-panel GitHub Wiki

The backend_users have a role which indicates their user level The roles can be configured in the adminpanel.json

Index 0 in the array is highest user level and last in array is lowest

Here is some examples of using the gate system

swift

Gate.allow(backendUser, "super-admin") // Returns Bool
Gate.disallow(backendUser, "super-admin") // Returns Bool
try Gate.allowOrFail(backendUser, "super-admin") // throws a 403 if user does not have access

Gate.allow(request, "super-admin") // Returns Bool
Gate.disallow(request, "super-admin") // Returns Bool
try Gate.allowOrFail(request, "super-admin") // throws a 403 if user does not have access

leaf

#allow(request, "super-admin") {
    //Html here
}