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


PHP UserAccess::getAccessListItems方法代碼示例

本文整理匯總了PHP中UserAccess::getAccessListItems方法的典型用法代碼示例。如果您正苦於以下問題:PHP UserAccess::getAccessListItems方法的具體用法?PHP UserAccess::getAccessListItems怎麽用?PHP UserAccess::getAccessListItems使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在UserAccess的用法示例。


在下文中一共展示了UserAccess::getAccessListItems方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getAccessListItems

 public function getAccessListItems($accessType = PermissionKey::ACCESS_TYPE_INCLUDE, $filterEntities = array())
 {
     $db = Database::connection();
     $list = parent::getAccessListItems($accessType, $filterEntities);
     foreach ($list as $l) {
         $pe = $l->getAccessEntityObject();
         if ($this->permissionObjectToCheck instanceof Page && $l->getAccessType() == PermissionKey::ACCESS_TYPE_INCLUDE) {
             $permission = 'A';
         } else {
             $permission = $db->fetchColumn('select permission from UserPermissionViewAttributeAccessList where paID = ? and peID = ?', array($l->getPermissionAccessID(), $pe->getAccessEntityID()));
             if ($permission != 'N' && $permission != 'C') {
                 $permission = 'A';
             }
         }
         $l->setAttributesAllowedPermission($permission);
         if ($permission == 'C') {
             $akIDs = $db->GetCol('select akID from UserPermissionViewAttributeAccessListCustom where paID = ? and peID = ?', array($l->getPermissionAccessID(), $pe->getAccessEntityID()));
             $l->setAttributesAllowedArray($akIDs);
         }
     }
     return $list;
 }
開發者ID:ceko,項目名稱:concrete5-1,代碼行數:22,代碼來源:ViewUserAttributesUserAccess.php

示例2: getAccessListItems

 public function getAccessListItems($accessType = UserPermissionKey::ACCESS_TYPE_INCLUDE, $filterEntities = array())
 {
     $db = Loader::db();
     $list = parent::getAccessListItems($accessType, $filterEntities);
     $list = PermissionDuration::filterByActive($list);
     foreach ($list as $l) {
         $pe = $l->getAccessEntityObject();
         $prow = $db->GetRow('select attributePermission, uName, uPassword, uEmail, uAvatar, uTimezone, uDefaultLanguage from UserPermissionEditPropertyAccessList where peID = ? and paID = ?', array($pe->getAccessEntityID(), $this->getPermissionAccessID()));
         if (is_array($prow) && $prow['attributePermission']) {
             $l->setAttributesAllowedPermission($prow['attributePermission']);
             $l->setAllowEditUserName($prow['uName']);
             $l->setAllowEditEmail($prow['uEmail']);
             $l->setAllowEditPassword($prow['uPassword']);
             $l->setAllowEditAvatar($prow['uAvatar']);
             $l->setAllowEditTimezone($prow['uTimezone']);
             $l->setAllowEditDefaultLanguage($prow['uDefaultLanguage']);
             $attributePermission = $prow['attributePermission'];
         } else {
             if ($l->getAccessType() == UserPermissionKey::ACCESS_TYPE_INCLUDE) {
                 $l->setAttributesAllowedPermission('A');
                 $l->setAllowEditUserName(1);
                 $l->setAllowEditEmail(1);
                 $l->setAllowEditPassword(1);
                 $l->setAllowEditAvatar(1);
                 $l->setAllowEditTimezone(1);
                 $l->setAllowEditDefaultLanguage(1);
             } else {
                 $l->setAttributesAllowedPermission('N');
                 $l->setAllowEditUserName(0);
                 $l->setAllowEditEmail(0);
                 $l->setAllowEditPassword(0);
                 $l->setAllowEditAvatar(0);
                 $l->setAllowEditTimezone(0);
                 $l->setAllowEditDefaultLanguage(0);
             }
         }
         if ($attributePermission == 'C') {
             $akIDs = $db->GetCol('select akID from UserPermissionEditPropertyAttributeAccessListCustom where peID = ? and paID = ?', array($pe->getAccessEntityID(), $this->getPermissionAccessID()));
             $l->setAttributesAllowedArray($akIDs);
         }
     }
     return $list;
 }
開發者ID:ngreimel,項目名稱:kovent,代碼行數:43,代碼來源:EditUserPropertiesUserAccess.php


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