本文整理匯總了PHP中PermissionAccess::getPermissionObject方法的典型用法代碼示例。如果您正苦於以下問題:PHP PermissionAccess::getPermissionObject方法的具體用法?PHP PermissionAccess::getPermissionObject怎麽用?PHP PermissionAccess::getPermissionObject使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PermissionAccess
的用法示例。
在下文中一共展示了PermissionAccess::getPermissionObject方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getAccessEntityUsers
public function getAccessEntityUsers(PermissionAccess $pae) {
if ($pae instanceof PagePermissionAccess) {
$c = $pae->getPermissionObject();
} else if ($pae instanceof AreaPermissionAccess) {
$c = $pae->getPermissionObject()->getAreaCollectionObject();
} else if ($pae instanceof BlockPermissionAccess) {
$a = $pae->getPermissionObject()->getBlockAreaObject();
$c = $a->getAreaCollectionObject();
}
if (is_object($c) && ($c instanceof Page)) {
$ui = UserInfo::getByID($c->getCollectionUserID());
$users = array($ui);
return $users;
}
}
示例2: getAccessEntityUsers
public function getAccessEntityUsers(PermissionAccess $pae)
{
if ($pae instanceof PagePermissionAccess) {
$c = $pae->getPermissionObject();
}
if (is_object($c) && $c instanceof Page) {
$pcID = $c->getCollectionParentID() ?: $c->getCollectionID();
// Check against this page, if no parent set
$ui = UserInfo::getByID($pcID);
$users = array($ui);
return $users;
}
}
示例3: validate
public function validate(PermissionAccess $pae)
{
if ($pae instanceof FileSetPermissionAccess) {
return true;
}
if ($pae instanceof FilePermissionAccess) {
$f = $pae->getPermissionObject();
}
if (is_object($f)) {
$u = new User();
return $u->getUserID() == $f->getUserID();
}
return false;
}