Role
class Role extends UrlModel implements NamedModel
A role a player is assigned
Constants
DEVELOPER |
|
ADMINISTRATOR |
|
COP |
|
REFEREE |
|
SYSADMIN |
|
PLAYER |
|
PLAYER_NO_PM |
|
TABLE |
The name of the database table used for queries |
CREATE_PERMISSION |
|
EDIT_PERMISSION |
|
SOFT_DELETE_PERMISSION |
|
HARD_DELETE_PERMISSION |
|
Methods
Check whether or not this role should appear on the "Admins" page
Get the color this role will have as the background in their badge
Get the "display name" of a role. The display name differs from the name of the role where the "Administrators" role can be displayed as "League Council" when the role is used to displayed players assigned to this role.
Get the order this role should be displayed on the "Admins" page
Get the Font Awesome class that will be used as the symbol for the role on the "Admins" page
Get the name of the role as displayed in the admin interface
Check if this role is for a conversation of users or if it's a role for a single user
Check if this role is protected from being deleted
Get the permissions a role has
Return the permissions a role has as models
Check whether a role has a specified permission
Set whether the Role is displayed as a leader role
Set the icon class of the role
Set the color of the role
Set the display name of the role
Set the display order of the role
Create a new role
Get the roles that should be displayed on the "Admins" page
Get a query builder for Roles
Details
at line line 119
bool
displayAsLeader()
Check whether or not this role should appear on the "Admins" page
at line line 130
string
getDisplayColor()
Get the color this role will have as the background in their badge
at line line 141
string
getDisplayName()
Get the "display name" of a role. The display name differs from the name of the role where the "Administrators" role can be displayed as "League Council" when the role is used to displayed players assigned to this role.
at line line 151
int
getDisplayOrder()
Get the order this role should be displayed on the "Admins" page
at line line 161
string
getDisplayIcon()
Get the Font Awesome class that will be used as the symbol for the role on the "Admins" page
at line line 171
Player[]
getUsers()
Get an array of players who have this role assigned to them
at line line 186
string
getName()
Get the name of the role as displayed in the admin interface
at line line 196
bool
isReusable()
Check if this role is for a conversation of users or if it's a role for a single user
at line line 206
bool
isProtected()
Check if this role is protected from being deleted
at line line 218
bool
addPerm(string|Permission $perm_name)
Add a permission to a role
at line line 228
bool[]
getPerms()
Get the permissions a role has
at line line 248
Permission[]
getPermObjects()
Return the permissions a role has as models
at line line 260
bool
hasPerm(string $permission)
Check whether a role has a specified permission
at line line 272
bool
removePerm(string|Permission $perm_name)
Revoke a permission from a role
at line line 322
Role
setPerms(Permission[] $perms)
Set the permissions of the role
at line line 351
Role
setName(string $name)
Set the name of the role
at line line 362
Role
setDisplayAsLeader(bool $display)
Set whether the Role is displayed as a leader role
at line line 373
Role
setDisplayIcon(string $displayIcon)
Set the icon class of the role
at line line 384
Role
setDisplayColor(string $displayColor)
Set the color of the role
at line line 395
Role
setDisplayName(string $displayName)
Set the display name of the role
at line line 406
Role
setDisplayOrder(int $displayOrder)
Set the display order of the role
at line line 424
static Role
createNewRole(string $name, bool $reusable, bool $display = false, string $displayIcon = '', string $displayColor = '', null $displayName = null, int $displayOrder)
Create a new role
at line line 445
static Role[]
getRoles(int $user_id)
Get the roles a player has
at line line 460
static Role[]
getLeaderRoles()
Get the roles that should be displayed on the "Admins" page
at line line 474
static QueryBuilder
getQueryBuilder()
Get a query builder for Roles