本文整理汇总了PHP中eZContentObject::checkGroupLimitationAccess方法的典型用法代码示例。如果您正苦于以下问题:PHP eZContentObject::checkGroupLimitationAccess方法的具体用法?PHP eZContentObject::checkGroupLimitationAccess怎么用?PHP eZContentObject::checkGroupLimitationAccess使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZContentObject
的用法示例。
在下文中一共展示了eZContentObject::checkGroupLimitationAccess方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkAccess
//.........这里部分代码省略.........
} else {
$languageMask = -1;
}
}
// Fetch limit mask for limitation list
$limitMask = eZContentLanguage::maskByLocale($limitationArray[$key]);
if (($languageMask & $limitMask) != 0) {
$access = 'allowed';
} else {
$access = 'denied';
$limitationList = array('Limitation' => $key, 'Required' => $limitationArray[$key]);
}
break;
case 'Owner':
case 'ParentOwner':
// if limitation value == 2, anonymous limited to current session.
if (in_array(2, $limitationArray[$key]) && $user->isAnonymous()) {
$createdObjectIDList = eZPreferences::value('ObjectCreationIDList');
if ($createdObjectIDList && in_array($contentobject->ID, unserialize($createdObjectIDList))) {
$access = 'allowed';
}
} else {
if ($contentobject->attribute('owner_id') == $userID || $contentobject->ID == $userID) {
$access = 'allowed';
}
}
if ($access != 'allowed') {
$access = 'denied';
$limitationList = array('Limitation' => $key, 'Required' => $limitationArray[$key]);
}
break;
case 'Group':
case 'ParentGroup':
$access = $contentobject->checkGroupLimitationAccess($limitationArray[$key], $userID);
if ($access != 'allowed') {
$access = 'denied';
$limitationList = array('Limitation' => $key, 'Required' => $limitationArray[$key]);
}
break;
case 'State':
if (count(array_intersect($limitationArray[$key], $contentobject->attribute('state_id_array'))) == 0) {
$access = 'denied';
$limitationList = array('Limitation' => $key, 'Required' => $limitationArray[$key]);
} else {
$access = 'allowed';
}
break;
case 'Node':
$accessNode = false;
$mainNodeID = $contentobject->attribute('main_node_id');
foreach ($limitationArray[$key] as $nodeID) {
$node = eZContentObjectTreeNode::fetch($nodeID, false, false);
$limitationNodeID = $node['main_node_id'];
if ($mainNodeID == $limitationNodeID) {
$access = 'allowed';
$accessNode = true;
break;
}
}
if ($access != 'allowed' && $checkedSubtree && !$accessSubtree) {
$access = 'denied';
// ??? TODO: if there is a limitation on Subtree, return two limitations?
$limitationList = array('Limitation' => $key, 'Required' => $limitationArray[$key]);
} else {
$access = 'allowed';
}