本文整理汇总了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;
}
示例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;
}