$dates
$dates :
The Role model for the Smarticops features.
byName( $name) : null
Retrieves a role by its name
| $name | string The name of the desired role |
if no role of this name
| None found |
loadPermissions()
Loads all the permissions associated to the role from the database.
To avoid too many requests to the DB
| None found |
givePermission( $permissionCode, boolean $value = true)
Gives a specific permission to the role.
The permission must exist before giving it to the role. By default the permission is set to true, you may set it to false to explicitly mean that the role does NOT have that permission.
| $permissionCode | ||
| boolean | $value | Value of the permission, usually true |
| None found |
hasPermission( $permissionCode) : boolean
Checks if a role has a permission or not.
| $permissionCode | the code of the permission to test |
true if the role has the permission
| None found |
removePermission(string $permissionCode)
Removes a Permission from a role
| string | $permissionCode |
| None found |
| None found |