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


PHP can_write函数代码示例

本文整理汇总了PHP中can_write函数的典型用法代码示例。如果您正苦于以下问题:PHP can_write函数的具体用法?PHP can_write怎么用?PHP can_write使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: canEdit

	/**
	 * @param Contact $user
	 * @return boolean
	 */
	function canEdit(Contact $user) {
		$userId = $user->getId();
		$creatorId = $this->getCreatedById();
		$object = $this->getRelObject();
		if (!$object instanceof ContentDataObject) {
			return false;
		}
		return can_write($user, $object->getMembers(), $object->getObjectTypeId()) && ($user->isAdministrator() || $userId == $creatorId);
	} // canEdit
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:13,代码来源:Comment.class.php

示例2: canEdit

 /**
  * Returns true if $user can edit this email
  *
  * @param User $user
  * @return boolean
  */
 function canEdit(User $user)
 {
     return can_write($user, $this);
     //		return $this->getAccount()->getUserId() == $user->getId() || $user->isAdministrator();
 }
开发者ID:pnagaraju25,项目名称:fengoffice,代码行数:11,代码来源:MailContent.class.php

示例3: canEdit

 /**
  * Check if specific user can edit this file
  *
  * @access public
  * @param User $user
  * @return boolean
  */
 function canEdit(User $user)
 {
     return can_write($user, $this);
 }
开发者ID:pnagaraju25,项目名称:fengoffice,代码行数:11,代码来源:ProjectFileRevision.class.php

示例4: canEdit

 /**
  * Empty implementation of static method. Update tag permissions are check by the taggable
  * object, not tag itself
  *
  * @param User $user
  * @return boolean
  */
 function canEdit(User $user)
 {
     $userId = $user->getId();
     $creatorId = $this->getCreatedById();
     return can_write($user, $this) && ($user->isAdministrator() || $userId == $creatorId);
 }
开发者ID:pnagaraju25,项目名称:fengoffice,代码行数:13,代码来源:Comment.class.php

示例5: canEdit

 /**
  * Check if specific user can edit this report
  *
  * @access public
  * @param Contact $user
  * @return boolean
  */
 function canEdit(Contact $user)
 {
     return can_write($user, $this->getMembers(), $this->manager()->getObjectTypeId());
 }
开发者ID:abhinay100,项目名称:feng_app,代码行数:11,代码来源:Report.class.php

示例6: canEdit

	/**
	 * Returns true if $user can edit this email
	 *
	 * @param Contact $user
	 * @return boolean
	 */
	function canEdit(Contact $user) {	
		$account = $this->getAccount();
		if ($account) {
			return ( 
				$account->getContactId() == logged_user()->getId() || 
				can_write($user, $this->getMembers(), $this->getObjectTypeId())
			);	
		}else{
			return can_write($user, $this->getMembers(), $this->getObjectTypeId());
		}
	} 
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:17,代码来源:MailContent.class.php

示例7: canCheckin

 function canCheckin(Contact $user)
 {
     return $this->isCheckedOut() && can_write($user, $this->getMembers(), $this->getObjectTypeId()) && ($user->isAdministrator() || $user->isModerator() || $user->getId() == $this->getCheckedOutById());
 }
开发者ID:abhinay100,项目名称:fengoffice_app,代码行数:4,代码来源:ProjectFile.class.php

示例8: canEdit

 /**
  * Check if specific user can edit this contact
  *
  * @access public
  * @param User $user
  * @return boolean
  */
 function canEdit(User $user)
 {
     if ($this->getUserId()) {
         // a contact that has a user assigned to it can be modified by anybody that can manage security (this is: users and permissions) or the user himself.
         return can_manage_contacts($user, true) || can_manage_security($user) || $this->getUserId() == $user->getId() || can_write($user, $this);
     } else {
         return can_manage_contacts($user, true) || can_write($user, $this);
     }
 }
开发者ID:pnagaraju25,项目名称:fengoffice,代码行数:16,代码来源:Contact.class.php

示例9: wget

/**
 * http download a file from the given url and save it into the given filename
 * @param string      $url          url
 * @param string      $path         filename (eg: /tmp/toto.txt)
 * @access public
 * @return void
 */
function wget($url, $path)
{
    if (!can_write($path)) {
        return false;
    }
    $from = @fopen($url, 'rb');
    $to = @fopen($path, 'w');
    $error = false;
    while (!feof($from) && !$error) {
        $buffer = @fread($from, 1024);
        if ($buffer === FALSE || fwrite($to, $buffer) === FALSE) {
            $error = true;
        }
    }
    fclose($to);
    fclose($from);
    if ($error) {
        unlink($to);
    }
    return !$error;
}
开发者ID:vincenta,项目名称:achievements,代码行数:28,代码来源:application_helper.php

示例10: canAddComment

 /**
  * Check if specific user can comment this message
  *
  * @access public
  * @param void
  * @return boolean
  */
 function canAddComment(User $user)
 {
     return can_write($user, $this);
 }
开发者ID:pnagaraju25,项目名称:fengoffice,代码行数:11,代码来源:ProjectMessage.class.php

示例11: canEdit

	/**
	 * Empty implementation of static method. Update tag permissions are check by the taggable
	 * object, not tag itself
	 *
	 * @param User $user
	 * @return boolean
	 */
	function canEdit(Contact $user) {
		return can_write($user,$this);
	} // canEdit
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:10,代码来源:BillingCategory.class.php

示例12: canChangeStatus

 /**
  * Can chagne status of this milestone (completed / open)
  *
  * @access public
  * @param User $user
  * @return boolean
  */
 function canChangeStatus(User $user)
 {
     return can_write($user, $this);
 }
开发者ID:pnagaraju25,项目名称:fengoffice,代码行数:11,代码来源:ProjectMilestone.class.php

示例13: canEdit

 /**
  * Returns true if $user can edit this email
  *
  * @param Contact $user
  * @return boolean
  */
 function canEdit(Contact $user)
 {
     $account = $this->getAccount();
     $members = $this->getMembers();
     $persons_dim = Dimensions::findByCode('feng_persons');
     $tmp = array();
     foreach ($members as $m) {
         if (!$persons_dim instanceof Dimension || $m->getDimensionId() != $persons_dim->getId()) {
             $tmp[] = $m;
         }
     }
     $members = $tmp;
     if ($account instanceof MailAccount) {
         // if classified
         if (count($members) > 0) {
             return $account->getContactId() == logged_user()->getId() || can_write($user, $members, $this->getObjectTypeId());
         } else {
             $macs = MailAccountContacts::instance()->count(array('`account_id` = ? AND `contact_id` = ? AND `can_edit` = 1', $account->getId(), $user->getId()));
             return $account->getContactId() == logged_user()->getId() || $macs > 0;
         }
     } else {
         if (count($members) > 0) {
             return can_write($user, $members, $this->getObjectTypeId());
         } else {
             return false;
         }
     }
 }
开发者ID:abhinay100,项目名称:fengoffice_app,代码行数:34,代码来源:MailContent.class.php

示例14: canAddComment

	/**
	 * Check if specific user can comment this webpage
	 *
	 * @access public
	 * @param void
	 * @return boolean
	 */
	function canAddComment(Contact $user) {
		return can_write($user, $this->getMembers(), $this->getObjectTypeId());
	} // canAddComment
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:10,代码来源:ProjectWebpage.class.php

示例15: canUpdateOptions

 /**
  * Check if $user can update webpage options
  *
  * @param User $user
  * @return boolean
  */
 function canUpdateOptions(User $user)
 {
     return can_write($user, $this);
 }
开发者ID:pnagaraju25,项目名称:fengoffice,代码行数:10,代码来源:ProjectWebpage.class.php


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