Class Permission
Manages the permissions required for a specific call (Controller->action()).
If the user has not enough permissions, it returns a __throw_to action to redirect them to.
Namespace: Kernel\Providers
Package: Kernel
Example:
Usage:
Located at app/Kernel/Providers/Permission.php
Package: Kernel
Example:
; For LoginController, it should look something like [Login] __throw_to = "Login" ; any unauthorized request goes to the Login path (check routing.ini) * = 2 ; As a general rule, in this example all calls require being authenticated showLogin = 1 ; Of course, to log in you must be guest, so this has level=1 login = 1 ; user ; On submitting the login form, you are not authenticated yet! level=1 showLoginHome = 2 ; Once logged in, you go to the "admin zone": level=2
Usage:
Enter the name of the Controller (but without writing "Controller"; e.g., for HomeController, write [Home].
There is no ambiguity here, for there should be no direct access/permission to Model files.
By default, <Controller>@<action> has permission level = 1 for all controllers and actions.
That means, if you don't write it down there'll be no errors thrown, but also no security level!
Located at app/Kernel/Providers/Permission.php
public static
|
|
public
boolean
|
#
checkPermission( string $controller, string $method )
Returns whether the user has permission to acces a given method |
public
integer
|
|
public
|