The Hubzilla
 All Classes Namespaces Files Functions Variables Pages
Zotlabs\Access\AccessList Class Reference

AccessList class. More...

Public Member Functions

 __construct ($channel)
 Constructor for AccessList class. More...
 
 get_explicit ()
 Get if we are using the default constructor values or values that have been set explicitly. More...
 
 set ($arr, $explicit=true)
 Set access list from strings such as those in already existing stored data items. More...
 
 get ()
 Return an array consisting of the current access list components where the elements are directly storable. More...
 
 set_from_array ($arr, $explicit=true)
 Set access list components from arrays, such as those provided by acl_selector(). More...
 
 is_private ()
 Returns true if any access lists component is set. More...
 

Private Attributes

string $allow_cid
 Allow contacts. More...
 
string $allow_gid
 Allow groups. More...
 
string $deny_cid
 Deny contacts. More...
 
string $deny_gid
 Deny groups. More...
 
boolean $explicit
 Indicates if we are using the default constructor values or values that have been set explicitly. More...
 

Detailed Description

AccessList class.

A class to hold an AccessList object with allowed and denied contacts and groups.

Constructor & Destructor Documentation

Zotlabs\Access\AccessList::__construct (   $channel)

Constructor for AccessList class.

Note
The array to pass to the constructor is different from the array that you provide to the set() or set_from_array() functions.
Parameters
array$channelA channel array, where these entries are evaluated:
  • string channel_allow_cid => string of allowed cids
  • string channel_allow_gid => string of allowed gids
  • string channel_deny_cid => string of denied cids
  • string channel_deny_gid => string of denied gids

Member Function Documentation

Zotlabs\Access\AccessList::get ( )

Return an array consisting of the current access list components where the elements are directly storable.

Returns
Associative array with:
  • string allow_cid => string of allowed cids
  • string allow_gid => string of allowed gids
  • string deny_cid => string of denied cids
  • string deny_gid => string of denied gids
Zotlabs\Access\AccessList::get_explicit ( )

Get if we are using the default constructor values or values that have been set explicitly.

Returns
boolean
Zotlabs\Access\AccessList::is_private ( )

Returns true if any access lists component is set.

Returns
boolean Return true if any of allow_* deny_* values is set.
Zotlabs\Access\AccessList::set (   $arr,
  $explicit = true 
)

Set access list from strings such as those in already existing stored data items.

Note
The array to pass to this set function is different from the array that you provide to the constructor or set_from_array().
Parameters
array$arr
  • string allow_cid => string of allowed cids
  • string allow_gid => string of allowed gids
  • string deny_cid => string of denied cids
  • string deny_gid => string of denied gids
boolean$explicit(optional) default true
Zotlabs\Access\AccessList::set_from_array (   $arr,
  $explicit = true 
)

Set access list components from arrays, such as those provided by acl_selector().

For convenience, a string (or non-array) input is assumed to be a comma-separated list and auto-converted into an array.

Note
The array to pass to this set function is different from the array that you provide to the constructor or set().
Parameters
array$arrAn associative array with:
  • array|string contact_allow => array with cids or comma-seperated string
  • array|string group_allow => array with gids or comma-seperated string
  • array|string contact_deny => array with cids or comma-seperated string
  • array|string group_deny => array with gids or comma-seperated string
boolean$explicit(optional) default true

Member Data Documentation

string Zotlabs\Access\AccessList::$allow_cid
private

Allow contacts.

string Zotlabs\Access\AccessList::$allow_gid
private

Allow groups.

string Zotlabs\Access\AccessList::$deny_cid
private

Deny contacts.

string Zotlabs\Access\AccessList::$deny_gid
private

Deny groups.

boolean Zotlabs\Access\AccessList::$explicit
private

Indicates if we are using the default constructor values or values that have been set explicitly.


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