PHP Class BookStack\Role

Inheritance: extends Illuminate\Database\Eloquent\Model
Datei anzeigen Open project: ssddanbrown/bookstack Class Usage Examples

Protected Properties

Property Type Description
$fillable

Public Methods

Method Description
attachPermission ( RolePermission $permission ) Add a permission to this role.
detachPermission ( RolePermission $permission ) Detach a single permission from this role.
getRole ( $roleName ) : Role Get the role object for the specified role.
getSystemRole ( $roleName ) : Role Get the role object for the specified system role.
hasPermission ( $permissionName ) : boolean Check if this role has a permission.
jointPermissions ( ) : Illuminate\Database\Eloquent\Relations\HasMany Get all related JointPermissions.
permissions ( ) The RolePermissions that belong to the role.
users ( ) The roles that belong to the role.
visible ( ) : mixed Get all visible roles

Method Details

attachPermission() public method

Add a permission to this role.
public attachPermission ( RolePermission $permission )
$permission RolePermission

detachPermission() public method

Detach a single permission from this role.
public detachPermission ( RolePermission $permission )
$permission RolePermission

getRole() public static method

Get the role object for the specified role.
public static getRole ( $roleName ) : Role
$roleName
return Role

getSystemRole() public static method

Get the role object for the specified system role.
public static getSystemRole ( $roleName ) : Role
$roleName
return Role

hasPermission() public method

Check if this role has a permission.
public hasPermission ( $permissionName ) : boolean
$permissionName
return boolean

jointPermissions() public method

Get all related JointPermissions.
public jointPermissions ( ) : Illuminate\Database\Eloquent\Relations\HasMany
return Illuminate\Database\Eloquent\Relations\HasMany

permissions() public method

The RolePermissions that belong to the role.
public permissions ( )

users() public method

The roles that belong to the role.
public users ( )

visible() public static method

Get all visible roles
public static visible ( ) : mixed
return mixed

Property Details

$fillable protected_oe property

protected $fillable