当前位置: 首页>>代码示例>>PHP>>正文


PHP FileData::isOwner方法代码示例

本文整理汇总了PHP中FileData::isOwner方法的典型用法代码示例。如果您正苦于以下问题:PHP FileData::isOwner方法的具体用法?PHP FileData::isOwner怎么用?PHP FileData::isOwner使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FileData的用法示例。


在下文中一共展示了FileData::isOwner方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: 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;
     }
 }
开发者ID:tejdeeps,项目名称:tejcs.com,代码行数:18,代码来源:UserPermission_class.php

示例2: 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;
     }
 }
开发者ID:vzool,项目名称:opendocman,代码行数:25,代码来源:UserPermission_class.php

示例3: canAdmin

 /**
  * return whether if this user can admin $data_id
  * @param $data_id
  * @return bool
  */
 function canAdmin($data_id)
 {
     $filedata = new FileData($data_id, $this->connection);
     if (!$this->isForbidden($data_id) or !$filedata->isPublishable()) {
         if ($this->canUser($data_id, $this->ADMIN_RIGHT) or $this->dept_perms_obj->canAdmin($data_id) or $filedata->isOwner($this->id)) {
             return true;
         } else {
             false;
         }
     }
 }
开发者ID:scdogan,项目名称:opendocman,代码行数:16,代码来源:User_Perms_class.php


注:本文中的FileData::isOwner方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。