Skip to content
This repository was archived by the owner on Apr 20, 2024. It is now read-only.
Casper Rasmussen edited this page Mar 12, 2017 · 1 revision

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
}
Clone this wiki locally