本文整理汇总了PHP中Tasks::canAccess方法的典型用法代码示例。如果您正苦于以下问题:PHP Tasks::canAccess方法的具体用法?PHP Tasks::canAccess怎么用?PHP Tasks::canAccess使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tasks
的用法示例。
在下文中一共展示了Tasks::canAccess方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: frosso_project_tab_handle_on_project_tabs
/**
* Handle on prepare project overview event
*
* @param NamedList $tabs
* @param User $logged_user
* @param Project $project
* @param array $tabs_settings
* @param string $interface
*/
function frosso_project_tab_handle_on_project_tabs(&$tabs, &$logged_user, &$project, &$tabs_settings, $interface)
{
if ($interface == AngieApplication::INTERFACE_DEFAULT && Tasks::canAccess($logged_user, $project, false) && in_array('fred_pt', $tabs_settings)) {
$tabs->addBefore('fred_pt', array('text' => "Fred PT", 'url' => Router::assemble('frosso_tab_route', array('project_slug' => $project->getSlug())), 'icon' => $interface == AngieApplication::INTERFACE_DEFAULT ? AngieApplication::getImageUrl('icons/16x16/tasks-tab-icon.png', TASKS_MODULE) : AngieApplication::getImageUrl('icons/listviews/tasks.png', TASKS_MODULE, AngieApplication::INTERFACE_PHONE)), 'calendar');
}
// if
}
示例2: __before
/**
* Prepare controller
*/
function __before()
{
parent::__before();
if (!Tasks::canAccess($this->logged_user, $this->active_project)) {
$this->response->forbidden();
}
// if
// load project tabs
//$project_tabs = $this->active_project->getTabs($this->logged_user, AngieApplication::INTERFACE_DEFAULT);
$this->wireframe->tabs->setCurrentTab('fred_gc');
$this->wireframe->breadcrumbs->add('frosso_gc_route', lang('FRosso GC'), Router::assemble('frosso_gc_route', array('project_slug' => $this->active_project->getSlug())));
}
示例3: frosso_handle_on_milestone_sections
/**
* @param Project $project
* @param Milestone $milestone
* @param User $user
* @param NamedList $sections
* @param string $interface
*/
function frosso_handle_on_milestone_sections(&$project, &$milestone, &$user, &$sections, $interface)
{
//uncomment these lines to add a new tab, instead
if (Tasks::canAccess($user, $project)) {
Router::assemble('milestone_tasks', array('project_slug' => $project->getSlug(), 'milestone_id' => $milestone->getId()));
// $section = array(
// 'text' => lang('FRed'),
// 'url' => Router::assemble('tasks_frosso', array('project_slug' => $project->getSlug(), 'milestone_id' => $milestone->getId())),
// 'options' => array(),
// );
// $sections->add('frosso', $section);
}
// if
}