Cheetah
|
Public Member Functions | |
__construct ($sTable='', $sFieldId='', $sFieldOwnerId='') | |
getGroupChooser ($iOwnerId, $sModuleUri, $sActionName, $aDynamicGroups=array(), $sTitle="") | |
check ($sAction, $iObjectId, $iViewerId=0) | |
getFieldAction ($sAction) | |
isDynamicGroupMember ($mixedGroupId, $iObjectOwnerId, $iViewerId, $iObjectId) | |
Static Public Member Functions | |
static | isPrivacyPage () |
Public Attributes | |
$_oDb | |
Privacy settings for any content.
Integration of the content with privacy engine allows site member to organize the access to his content.
Related classes: ChWsbPrivacyQuery - database queries. ChWsbPrivacySearch - organize members search using necessary criteria. ChWsbPrivacyView - super class for all representations. ChBasePrivacyView - base template representation. ChTemplPrivacyView - custom template representation.
Example of usage:
sys_privacy_actions
database table.Add group choosers for necessary actions in the form, which is used to add new items.
$oPrivacy = new ChWsbPrivacy(); $oPrivacy->getGroupChooser($iItemOwnerId, $sModuleUri, $sModuleAction);
Check privacy when any user tries to view an item.
$oPrivacy = new ChWsbPrivacy($sTable, $sFieldId, $sFieldOwnerId); if($oPrivacy->check($sAction, $iObjectId, $iViewerId)) { //show necessary content }
Memberships/ACL: Doesn't depend on user's membership.
Alerts: no alerts available
Definition at line 59 of file ChWsbPrivacy.php.
ChWsbPrivacy::__construct | ( | $sTable = '' , |
|
$sFieldId = '' , |
|||
$sFieldOwnerId = '' |
|||
) |
constructor
Reimplemented in ChVideosPrivacy, ChSoundsPrivacy, ChPhotosPrivacy, and ChFilesPrivacy.
Definition at line 66 of file ChWsbPrivacy.php.
ChWsbPrivacy::check | ( | $sAction, | |
$iObjectId, | |||
$iViewerId = 0 |
|||
) |
Check whether the viewer can make requested action.
string | $sAction | action name from 'sys_priacy_actions' table. |
integer | $iObjectId | object ID the action to be performed with. |
integer | $iViewerId | viewer ID. |
Reimplemented in ChSimpleMessengerPrivacy.
Definition at line 127 of file ChWsbPrivacy.php.
ChWsbPrivacy::getFieldAction | ( | $sAction | ) |
Get database field name for action.
string | $sAction | action name. |
Reimplemented in ChVideosPrivacy, ChSoundsPrivacy, ChSitesPrivacy, ChPhotosPrivacy, ChFilesPrivacy, ChBlogsPrivacy, and ChAdsPrivacy.
Definition at line 154 of file ChWsbPrivacy.php.
ChWsbPrivacy::getGroupChooser | ( | $iOwnerId, | |
$sModuleUri, | |||
$sActionName, | |||
$aDynamicGroups = array() , |
|||
$sTitle = "" |
|||
) |
Get Select element with available groups.
integer | $iOwnerId | object's owner ID. |
string | $sModuleUri | module's unique URI. |
string | $sActionName | action name. |
array | $aDynamicGroups | an array of array('key' => group_id, 'value' => group_title). |
string | $sTitle | the title to be used for generated field. |
Definition at line 81 of file ChWsbPrivacy.php.
ChWsbPrivacy::isDynamicGroupMember | ( | $mixedGroupId, | |
$iObjectOwnerId, | |||
$iViewerId, | |||
$iObjectId | |||
) |
Check whethere viewer is a member of dynamic group.
mixed | $mixedGroupId | dynamic group ID. |
integer | $iObjectOwnerId | object owner ID. |
integer | $iViewerId | viewer ID. |
Reimplemented in ChStorePrivacyProduct, ChStorePrivacyFile, ChGroupsPrivacy, and ChEventsPrivacy.
Definition at line 167 of file ChWsbPrivacy.php.
|
static |
Static Method. Check whether Privacy Group page/menu is available.
Definition at line 176 of file ChWsbPrivacy.php.
ChWsbPrivacy::$_oDb |
Definition at line 61 of file ChWsbPrivacy.php.