public
|
#
__construct( flDb $db )
Construct the object.
Parameters
- $db
- The database object to use.
|
public
boolean
|
#
createPermissionGroup( string $name, string $displayName, string $textDomain = '' )
Create a permission group.
Create a permission group.
Parameters
- $name
- The name of the group to create.
- $displayName
- The display name of the group.
- $textDomain
- The optional text domain for translation.
Returns
boolean true if the group was created; else false.
|
public
|
#
deletePermissionGroup( string $name )
Delete a permission group and all the permissions in it.
Delete a permission group and all the permissions in it.
Parameters
- $name
- The name of the group to delete.
|
public
|
#
updatePermissionGroup( string $name, string $displayName, string $textDomain = '' )
Update the display name of a permission group.
Update the display name of a permission group.
Parameters
- $name
- The name of the permission group to update.
- $displayName
- The mew display name of the permission group.
- $textDomain
- The optional text domain for translation.
|
public
boolean
|
#
createPermission( string $name, string $displayName, integer $displayOrder = 0, string $textDomain = '' )
Create a permission in a permission group.
Create a permission in a permission group.
Parameters
- $name
- The name of the permission to add, 'group.perm'.
- $displayName
- The display name of the permission.
- $displayOrder
- The smaller numbers show before the larger.
- $textDomain
- The optional text domain for translation.
Returns
boolean true if the permission was added; else false.
|
public
|
#
deletePermission( string $name )
Delete a permission.
If the permission group is empty then the group is deleted as well.
Parameters
- $name
- The name of the permission to delete.
|
public
boolean
|
#
updatePermission( string $name, string $displayName, string $textDomain = '' )
Update the display name of a permission.
Update the display name of a permission.
Parameters
- $name
- The name of the permission to update.
- $displayName
- The mew display name of the permission.
- $textDomain
- The optional text domain for translation.
Returns
boolean true if the permission updated; else false.
|
public
array
|
#
getPermissions( )
Get a list of all the permission grouped by their groups.
Get a list of all the permission grouped by their groups.
Returns
array Array of groups and their permissions.
|
public
array
|
#
getPermissionsInGroup( string $group )
Get a list of all the permission in a specific group.
Get a list of all the permission in a specific group.
Parameters
- $group
- The group to get the permissions for.
Returns
array Permissions and their display names.
|
public
string
|
#
getPermissionDisplayName( string $perm )
Get the display name of a permission.
Get the display name of a permission.
Parameters
- $perm
- The name of the permission to get the display name of.
Returns
string the display name of the permission.
|
public
integer
|
#
createRole( string $name, string $displayName )
Create a new role.
Parameters
- $name
- The name of the role.
- $displayName
- The display name.
Returns
integer The ID of the role or 0 if it failed to create.
|
public
|
#
deleteRole( integer $roleid )
Delete a role.
Role 1, the admin role can't be deleted.
Parameters
- $roleid
- ID of the role to delete.
|
public
|
#
updateRole( integer $roleid, string $name, string $displayName )
Update the display name of a role.
Update the display name of a role.
Parameters
- $roleid
- The id of the role to update.
- $name
- The name of the role.
- $displayName
- The mew display name of the role.
|
public
string
|
#
getRoleDisplayName( integer $roleid )
Get the display name of a role.
Get the display name of a role.
Parameters
- $roleid
- The ID of the role to get.
Returns
string The display name of the role.
|
public
array
|
#
getRoleInfo( integer $roleid )
Get the role name and display name.
Get the role name and display name.
Parameters
- $roleid
- The ID of the role to get.
Returns
array The 'rolename' and 'displayname' of the role.
|
public
array
|
#
getRoles( )
Get the roles available in the system.
Get the roles available in the system.
Returns
array Array of role IDs and their display names.
|
public
|
#
setRolePermissions( integer $roleid, array $permissions )
Set the permissions for a role. Changes to the admin permissions are ignored.
Set the permissions for a role. Changes to the admin permissions are ignored.
Parameters
- $roleid
- The id of the role to set the permissions for.
- $permissions
- Array of permissions for the role.
Throws
|
public
array
|
#
getRolePermissions( integer $roleid, string $grp = null )
Get the permissions set on a role.
Get the permissions set on a role.
Parameters
- $roleid
- The id of the role to get the permissions for.
- $grp
- Optional group to limit the permissions returned to.
Returns
array Array of permissions.
|