本文整理汇总了PHP中FileData::isLocked方法的典型用法代码示例。如果您正苦于以下问题:PHP FileData::isLocked方法的具体用法?PHP FileData::isLocked怎么用?PHP FileData::isLocked使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileData
的用法示例。
在下文中一共展示了FileData::isLocked方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getAuthority
/**
* getAuthority
* Return the authority that this user have on file data_id
* by combining and prioritizing user and department right
* @param int $data_id
* @return int
*/
public function getAuthority($data_id)
{
$data_id = (int) $data_id;
$fileData = new FileData($data_id, $this->connection);
if ($this->user_obj->isAdmin() || $this->user_obj->isReviewerForFile($data_id)) {
return $this->ADMIN_RIGHT;
}
if ($fileData->isOwner($this->uid) && $fileData->isLocked()) {
return $this->WRITE_RIGHT;
}
$user_permissions = $this->user_perms_obj->getPermission($data_id);
$department_permissions = $this->dept_perms_obj->getPermission($data_id);
if ($user_permissions >= $this->user_perms_obj->NONE_RIGHT and $user_permissions <= $this->user_perms_obj->ADMIN_RIGHT) {
return $user_permissions;
} else {
return $department_permissions;
}
}
示例2: getAuthority
function getAuthority($data_id)
{
$data_id = (int) $data_id;
$fileData = new FileData($data_id, $GLOBALS['connection'], DB_NAME);
if ($this->user_obj->isAdmin() || $this->user_obj->isReviewerForFile($data_id)) {
return $this->ADMIN_RIGHT;
}
if ($fileData->isOwner($this->uid) && $fileData->isLocked()) {
return $this->WRITE_RIGHT;
}
$uperm = $this->userperm_obj->getPermission($data_id);
$dperm = $this->deptperm_obj->getPermission($data_id);
if ($uperm >= $this->userperm_obj->NONE_RIGHT and $uperm <= $this->userperm_obj->ADMIN_RIGHT) {
return $uperm;
} else {
return $dperm;
}
}