class vB_ChannelPermission

Channel Permissions interface Provides methods used in admincp to read and set channel- specific permissions.

*

Traits

Constants

TYPE_BITMAP

TYPE_HOURS

TYPE_COUNT

TYPE_BOOL

Properties

static protected $permissionFields
static protected $bitfieldsUsed
static protected $permissionPhrases
static protected $bitfieldGroup
static protected $instance
static protected $usergroups
protected $permSettings
protected $defaultPermissions

Methods

__sleep()

No description

__wakeup()

No description

__construct()

No description

instance()

Returns singleton instance of self.

mixed
formatPermissions($permissions)

this formats the result of a query

fetchPermissions($nodeid, $groupid = false)

this returns a specific permission setting

setPermissions($nodeid, $groupid, $permissions, $updatedefault = false)

this sets permissions for a node and group.

fetchPermSettings()

this returns the basic settings array.

mixed
fetchPermById($permissionid)

this returns a permission setting by permissionid

static 
fetchPermFields()

this returns the fields and types.

static 
fetchPermPhrases()

this returns the fields and types.

deletePerms($params)

this deletes an existing permission

static array
loadDefaultChannelPermissions($nodeid = 0, $groupid = 0)

Load default channel permissions

static bool
compareDefaultChannelPermissions($nodeid, $groupid, array $currentpermissioncache = array())

Compare current channel permissions with default ones.

Details

in vB_Trait_NoSerialize at line 15
__sleep()

in vB_Trait_NoSerialize at line 20
__wakeup()

at line 142
protected __construct()

at line 211
static vB_ChannelPermission instance()

Returns singleton instance of self.

Return Value

vB_ChannelPermission
  • Reference to singleton instance of the type handler

at line 230
protected mixed formatPermissions($permissions)

this formats the result of a query

@param mixed a query result object

Parameters

$permissions

Return Value

mixed array of $groupid => array(permission fields). Empty array if no permissions set for that node.

at line 285
fetchPermissions($nodeid, $groupid = false)

this returns a specific permission setting

@param integer the node for which we are checking permissions

Parameters

$nodeid
$groupid

at line 355
setPermissions($nodeid, $groupid, $permissions, $updatedefault = false)

this sets permissions for a node and group.

@param integer the node for which we are setting permissions

Parameters

$nodeid
$groupid
$permissions
$updatedefault

at line 447
fetchPermSettings()

this returns the basic settings array.

@return mixed the permSettings array

at line 460
mixed fetchPermById($permissionid)

this returns a permission setting by permissionid

@param integer the permissionid

Parameters

$permissionid

Return Value

mixed array of $groupid => array(permission fields). Empty array if no permissions set for that node.

at line 485
static fetchPermFields()

this returns the fields and types.

@return mixed the $permissionFields array

at line 495
static fetchPermPhrases()

this returns the fields and types.

@return mixed the $permissionFields array

at line 506
deletePerms($params)

this deletes an existing permission

@return mixed either permissionid(single or array), or nodeid and usergroupid. A single Nodeid is required and usergroup is optional and may be an array

Parameters

$params

at line 539
buildDefaultChannelPermsDatastore()

at line 570
static array loadDefaultChannelPermissions($nodeid = 0, $groupid = 0)

Load default channel permissions

Parameters

$nodeid int Node ID
$groupid int Group ID

Return Value

array Channel permissions

at line 593
static bool compareDefaultChannelPermissions($nodeid, $groupid, array $currentpermissioncache = array())

Compare current channel permissions with default ones.

Parameters

$nodeid int Node ID
$groupid int Group ID
array $currentpermissioncache If set the function won't try to load

Return Value

bool If current permissions are modified, return true. Otherwise false.