vBulletin v6.0.4

vB_PermissionContext
in package
Uses vB_Trait_NoSerialize

Table of Contents

Methods

__construct()  : mixed
__serialize()  : array<string|int, mixed>
__sleep()  : array<string|int, mixed>
__unserialize()  : void
__wakeup()  : void
clearAttachmentPermissions()  : mixed
Clear out the attachment permissions.
clearChannelPermissions()  : mixed
Clears all existing permissions. Needed primarily in test.
getAdminUser()  : mixed
Gets an admin user. This is defined as one that can administer the admincp
getAdminUsergroups()  : array<string|int, mixed>
Gets any admin usergroups. This is defined as one that can administer permissions
getAllChannelAccess()  : mixed
This returns an array with the access for each usergroup passed.
getAttachmentPermissions()  : bool|array<string|int, mixed>
Get the attachment limits for an extension and usergroupid. If that usergroup does not have permission or the extension is not in the list of allowed extensions, return false.
getBitfield()  : mixed
getChannelid()  : mixed
getChannelPermission()  : mixed
getChannelPermissionGroup()  : mixed
getChannelPermissionGroupInfractionMask()  : mixed
getChannelPermissiongroupPermissives()  : mixed
getForumPerms()  : array<string|int, mixed>
Returns the available permissions
getGroupsChannelLimitPermission()  : mixed
getLimit()  : mixed
getPermission()  : mixed
getPermissions()  : array<string|int, mixed>
Returns permissions array. This is used for unit testing
getUserGroups()  : array<string|int, mixed>
Return an array with usergroups that can provide permissions Extracted from includes/functions.php::cache_permissions
hasPermission()  : bool
Does this group have the requested system permissions
isLimitPermission()  : mixed
isNumericPermission()  : mixed
loadChannelPermissions()  : mixed
This loads a permission group from the database and caches the results
rebuildGroupAccess()  : mixed
This rebuilds the array of channel access by group

Methods

__construct()

public __construct(mixed $datastore, mixed $primary_group_id[, array<string|int, mixed> $secondary_group_ids = [] ][, array<string|int, mixed> $infraction_group_ids = [] ]) : mixed
Parameters
$datastore : mixed
$primary_group_id : mixed
$secondary_group_ids : array<string|int, mixed> = []
$infraction_group_ids : array<string|int, mixed> = []

__serialize()

public __serialize() : array<string|int, mixed>
Return values
array<string|int, mixed>

__sleep()

public __sleep() : array<string|int, mixed>
Return values
array<string|int, mixed>

__unserialize()

public __unserialize(array<string|int, mixed> $serialized) : void
Parameters
$serialized : array<string|int, mixed>

clearAttachmentPermissions()

Clear out the attachment permissions.

public clearAttachmentPermissions() : mixed

clearChannelPermissions()

Clears all existing permissions. Needed primarily in test.

public clearChannelPermissions([int $usergroupid = false ]) : mixed
Parameters
$usergroupid : int = false

(optional)

getAdminUser()

Gets an admin user. This is defined as one that can administer the admincp

public static getAdminUser() : mixed

return false|integer a userid with admin permissions, false if not found

getAdminUsergroups()

Gets any admin usergroups. This is defined as one that can administer permissions

public static getAdminUsergroups([mixed $all = true ]) : array<string|int, mixed>
Parameters
$all : mixed = true
Return values
array<string|int, mixed>

-- user groupids

getAllChannelAccess()

This returns an array with the access for each usergroup passed.

public getAllChannelAccess(array<string|int, mixed>|int $usergroups) : mixed
Parameters
$usergroups : array<string|int, mixed>|int

-- usergroup ids

@return array on element for each usergroup with the following arrays (each is the array of nodeids the user has the appropriate permissons for) canview canalwaysview canaccess selfonly starteronly canseedelnotice canpublish

getAttachmentPermissions()

Get the attachment limits for an extension and usergroupid. If that usergroup does not have permission or the extension is not in the list of allowed extensions, return false.

public getAttachmentPermissions(mixed $usergroupid, mixed $extension) : bool|array<string|int, mixed>

Note: This is only constrained to the attachmenttype and attachmentpermission tables. The create permissions for all attachments are handled in the channels. TODO: Make this part of the channel permissions

Parameters
$usergroupid : mixed
$extension : mixed
Return values
bool|array<string|int, mixed>

false if not enabled for the usergroupid. array of limits if its enabled.

getBitfield()

public getBitfield(mixed $permissiongroup) : mixed
Parameters
$permissiongroup : mixed

getChannelid()

public getChannelid(mixed $nodeid) : mixed
Parameters
$nodeid : mixed

getChannelPermission()

public getChannelPermission(mixed $permissiongroup, mixed $permission, mixed $nodeid) : mixed
Parameters
$permissiongroup : mixed
$permission : mixed
$nodeid : mixed

getChannelPermissionGroup()

public getChannelPermissionGroup(mixed $permissiongroup, mixed $nodeid) : mixed
Parameters
$permissiongroup : mixed
$nodeid : mixed

getChannelPermissionGroupInfractionMask()

public getChannelPermissionGroupInfractionMask(mixed $permissiongroup, mixed $channelid) : mixed
Parameters
$permissiongroup : mixed
$channelid : mixed

getChannelPermissiongroupPermissives()

public getChannelPermissiongroupPermissives(mixed $usergroups, mixed $permissiongroup, mixed $channelid) : mixed
Parameters
$usergroups : mixed
$permissiongroup : mixed
$channelid : mixed

getForumPerms()

Returns the available permissions

public getForumPerms() : array<string|int, mixed>
Return values
array<string|int, mixed>

getGroupsChannelLimitPermission()

public getGroupsChannelLimitPermission(mixed $usergroups, mixed $permissiongroup, mixed $permission, mixed $channelid) : mixed
Parameters
$usergroups : mixed
$permissiongroup : mixed
$permission : mixed
$channelid : mixed

getLimit()

public getLimit(mixed $permission) : mixed
Parameters
$permission : mixed

getPermission()

public getPermission(mixed $group) : mixed
Parameters
$group : mixed

getPermissions()

Returns permissions array. This is used for unit testing

public getPermissions([bool $get_bitmap = TRUE ][, bool $get_limit = TRUE ]) : array<string|int, mixed>
Parameters
$get_bitmap : bool = TRUE
$get_limit : bool = TRUE
Return values
array<string|int, mixed>

getUserGroups()

Return an array with usergroups that can provide permissions Extracted from includes/functions.php::cache_permissions

public getUserGroups() : array<string|int, mixed>
Return values
array<string|int, mixed>

hasPermission()

Does this group have the requested system permissions

public hasPermission(string $group, string $permission) : bool
Parameters
$group : string

Permission group the permission is in

$permission : string

Name of permission

Return values
bool

isLimitPermission()

public isLimitPermission(mixed $permission) : mixed
Parameters
$permission : mixed

isNumericPermission()

public isNumericPermission(mixed $permission) : mixed
Parameters
$permission : mixed

loadChannelPermissions()

This loads a permission group from the database and caches the results

public loadChannelPermissions(int $usergroupid) : mixed
Parameters
$usergroupid : int

rebuildGroupAccess()

This rebuilds the array of channel access by group

public rebuildGroupAccess() : mixed

This also sets the datastore keys vBUgChannelPermissionsFrom and vBUgChannelAccess

sets datastore values for each group, each datatore entity is an array of channel ids where a user in that group has that access -- canview -- canaccess -- selfonly -- starteronly -- canseedelnotice -- canpublish -- canmoderate


        
On this page

Search results