當前位置: 首頁>>代碼示例>>PHP>>正文


PHP eZContentObject::checkGroupLimitationAccess方法代碼示例

本文整理匯總了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';
                             }
開發者ID:rantoniazzi,項目名稱:xrowmetadata,代碼行數:67,代碼來源:xrowsitemaptools.php


注:本文中的eZContentObject::checkGroupLimitationAccess方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。