class permissions

Properties

protected dispatcher_interface $dispatcher

Event dispatcher object

protected user $user

User object

protected $types
protected $categories
protected $permissions

Methods

__construct(dispatcher_interface $phpbb_dispatcher, user $user)

Constructor

array
get_categories()

Returns an array with all the permission categories (pm, post, settings, misc, etc.)

string
get_category_lang(string $category)

Returns the language string of a permission category

array
get_types()

Returns an array with all the permission types (a, u, m_, etc.)

string
get_type_lang(string $type, mixed $scope = false)

Returns the language string of a permission type

array
get_permissions()

Returns an array with all the permissions.

string
get_permission_category(string $permission)

Returns the category of a permission

bool
category_defined(string $category)

Checks if a category has been defined

bool
permission_defined(string $permission)

Checks if a permission has been defined

string
get_permission_lang(string $permission)

Returns the language string of a permission

Details

at line 36
__construct(dispatcher_interface $phpbb_dispatcher, user $user)

Constructor

Parameters

dispatcher_interface $phpbb_dispatcher

Event dispatcher

user $user

User Object

at line 78
array get_categories()

Returns an array with all the permission categories (pm, post, settings, misc, etc.)

Return Value

array

Layout: cat-identifier => Language key

at line 89
string get_category_lang(string $category)

Returns the language string of a permission category

Parameters

string $category

Identifier of the category

Return Value

string

Language string

at line 99
array get_types()

Returns an array with all the permission types (a, u, m_, etc.)

Return Value

array

Layout: type-identifier => Language key

at line 111
string get_type_lang(string $type, mixed $scope = false)

Returns the language string of a permission type

Parameters

string $type

Identifier of the type

mixed $scope

Scope of the type (should be 'global', 'local' or false)

Return Value

string

Language string

at line 146
array get_permissions()

Returns an array with all the permissions.

Each Permission has the following layout: '' => array( 'lang' => 'Language Key with a Short description', // Optional, if not set, // the permissions identifier '' is used with // all uppercase. 'cat' => 'Identifier of the category, the permission should be displayed in', ), Example: 'u_viewprofile' => array( 'lang' => 'ACL_U_VIEWPROFILE', 'cat' => 'profile', ),

Return Value

array

at line 157
string get_permission_category(string $permission)

Returns the category of a permission

Parameters

string $permission

Identifier of the permission

Return Value

string

Returns the category identifier of the permission

at line 168
bool category_defined(string $category)

Checks if a category has been defined

Parameters

string $category

Identifier of the category

Return Value

bool

True if the category is defined, false otherwise

at line 179
bool permission_defined(string $permission)

Checks if a permission has been defined

Parameters

string $permission

Identifier of the permission

Return Value

bool

True if the permission is defined, false otherwise

at line 190
string get_permission_lang(string $permission)

Returns the language string of a permission

Parameters

string $permission

Identifier of the permission

Return Value

string

Language string