Unify task drop-down menu between different views

This commit is contained in:
Frederic Guillot
2016-05-04 21:51:38 -04:00
parent 60c8867fee
commit 6bdc25490f
15 changed files with 152 additions and 171 deletions

View File

@@ -71,6 +71,8 @@ class TaskFinder extends Base
'tasks.priority',
'tasks.time_spent',
'tasks.time_estimated',
'tasks.is_active',
'tasks.creator_id',
'projects.name AS project_name'
)
->join(Project::TABLE, 'id', 'project_id')

View File

@@ -1,34 +0,0 @@
<?php
namespace Kanboard\Model;
use Kanboard\Core\Security\Role;
/**
* Task permission model
*
* @package model
* @author Frederic Guillot
*/
class TaskPermission extends Base
{
/**
* Return true if the user can remove a task
*
* Regular users can't remove tasks from other people
*
* @public
* @param array $task
* @return bool
*/
public function canRemoveTask(array $task)
{
if ($this->userSession->isAdmin() || $this->projectUserRole->getUserRole($task['project_id'], $this->userSession->getId()) === Role::PROJECT_MANAGER) {
return true;
} elseif (isset($task['creator_id']) && $task['creator_id'] == $this->userSession->getId()) {
return true;
}
return false;
}
}