Bristol SU Support Package
Public Member Functions | List of all members
BristolSU\Support\Permissions\Contracts\Models\Permission Interface Reference
Inheritance diagram for BristolSU\Support\Permissions\Contracts\Models\Permission:
Inheritance graph
[legend]
Collaboration diagram for BristolSU\Support\Permissions\Contracts\Models\Permission:
Collaboration graph
[legend]

Public Member Functions

 __construct (string $ability='', string $name='', string $description='')
 
 setAbility (string $ability)
 
 setName (string $name)
 
 setDescription (string $description)
 
 setType (string $type)
 
 setModuleAlias (?string $moduleAlias)
 
 setModuleType (?string $moduleType)
 
 getAbility ()
 
 getName ()
 
 getDescription ()
 
 getType ()
 
 getModuleAlias ()
 
 getModuleType ()
 

Detailed Description

Represents a permission registered in a Service Provider

Definition at line 11 of file Permission.php.

Constructor & Destructor Documentation

◆ __construct()

BristolSU\Support\Permissions\Contracts\Models\Permission::__construct ( string  $ability = '',
string  $name = '',
string  $description = '' 
)
Parameters
string$abilityAbility string for the permission
string$nameA name for the permission
string$descriptionA description for the permission

Member Function Documentation

◆ getAbility()

BristolSU\Support\Permissions\Contracts\Models\Permission::getAbility ( )

◆ getDescription()

BristolSU\Support\Permissions\Contracts\Models\Permission::getDescription ( )

Get the description of the permission

Returns
string Description of the permission

Implemented in BristolSU\Support\Permissions\Models\Permission.

◆ getModuleAlias()

BristolSU\Support\Permissions\Contracts\Models\Permission::getModuleAlias ( )

Get the alias of the module for which the permission belongs

Returns
string|null Alias of the module. Null if not a module permission

Implemented in BristolSU\Support\Permissions\Models\Permission.

Referenced by BristolSU\Support\Permissions\PermissionRepository\forModule().

◆ getModuleType()

BristolSU\Support\Permissions\Contracts\Models\Permission::getModuleType ( )

Get the type of module permission.

If the permission is an admin permission, this function should return 'administrator'. Otherwise, the function will return 'participant'.

Returns
string|null. administrator/participant. Null if not a module permission

Implemented in BristolSU\Support\Permissions\Models\Permission.

◆ getName()

BristolSU\Support\Permissions\Contracts\Models\Permission::getName ( )

Get the name of the permission

Returns
string Name of the permission

Implemented in BristolSU\Support\Permissions\Models\Permission.

◆ getType()

BristolSU\Support\Permissions\Contracts\Models\Permission::getType ( )

◆ setAbility()

BristolSU\Support\Permissions\Contracts\Models\Permission::setAbility ( string  $ability)

Set the ability string of the permission

Parameters
string$abilityAbility String
Returns
void

Implemented in BristolSU\Support\Permissions\Models\Permission.

◆ setDescription()

BristolSU\Support\Permissions\Contracts\Models\Permission::setDescription ( string  $description)

Set the description of the permission

Parameters
string$descriptionDescription of the permission
Returns
void

Implemented in BristolSU\Support\Permissions\Models\Permission.

◆ setModuleAlias()

BristolSU\Support\Permissions\Contracts\Models\Permission::setModuleAlias ( ?string  $moduleAlias)

Set the module alias for the permission

If the permission is a module permission, the module alias is the module which has registered the permission

Parameters
null | string$moduleAliasModule that registers the permission
Returns
void

Implemented in BristolSU\Support\Permissions\Models\Permission.

◆ setModuleType()

BristolSU\Support\Permissions\Contracts\Models\Permission::setModuleType ( ?string  $moduleType)

Set the module type.

If the permission is a module permission, this should either be 'administrator' or 'participant', depending on if the module is an admin or a participant permission.

Parameters
null | string$moduleType
Returns
mixed

Implemented in BristolSU\Support\Permissions\Models\Permission.

◆ setName()

BristolSU\Support\Permissions\Contracts\Models\Permission::setName ( string  $name)

Set the name of the permission

Parameters
string$nameName of the permission
Returns
void

Implemented in BristolSU\Support\Permissions\Models\Permission.

◆ setType()

BristolSU\Support\Permissions\Contracts\Models\Permission::setType ( string  $type)

Set the type of permission.

The type of the permission can either be 'global' for a system permission, or 'module' for a module permission

Parameters
string$typeType of the permission, either global or module
Returns
void

Implemented in BristolSU\Support\Permissions\Models\Permission.


The documentation for this interface was generated from the following file: