本文整理汇总了PHP中thebuggenie\core\entities\Project::getOwner方法的典型用法代码示例。如果您正苦于以下问题:PHP Project::getOwner方法的具体用法?PHP Project::getOwner怎么用?PHP Project::getOwner使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类thebuggenie\core\entities\Project
的用法示例。
在下文中一共展示了Project::getOwner方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: canAssignScrumUserStories
/**
* Return if the user can assign scrum user stories
*
* @param \thebuggenie\core\entities\Project $project
*
* @return boolean
*/
public function canAssignScrumUserStories(\thebuggenie\core\entities\Project $project)
{
if ($project->isArchived()) {
return false;
}
if ($this->canSaveConfiguration(framework\Settings::CONFIGURATION_SECTION_PROJECTS)) {
return true;
}
if ($project->getOwner() instanceof User && $project->getOwner()->getID() == $this->getID()) {
return true;
}
$retval = $this->hasPermission('canassignscrumuserstoriestosprints', $project->getID());
$retval = $retval !== null ? $retval : $this->hasPermission('candoscrumplanning', $project->getID());
$retval = $retval !== null ? $retval : $this->hasPermission('canassignscrumuserstoriestosprints', 0);
$retval = $retval !== null ? $retval : $this->hasPermission('candoscrumplanning', 0);
return (bool) ($retval !== null) ? $retval : false;
}
示例2: hasProjectPageAccess
/**
* Check whether the user can access the specified project page
*
* @param string $page The page key
* @param Project $project
*
* @return boolean
*/
public function hasProjectPageAccess($page, Project $project)
{
$retval = $this->hasPageAccess($page, $project->getID());
$retval = $retval === null ? $this->hasPageAccess('project_allpages', $project->getID()) : $retval;
if ($retval === null) {
if ($project->getOwner() instanceof User && $project->getOwner()->getID() == $this->getID()) {
return true;
}
if ($project->getLeader() instanceof User && $project->getLeader()->getID() == $this->getID()) {
return true;
}
}
return $retval !== null ? $retval : framework\Settings::isPermissive();
}