Allow project managers to remove tasks
This commit is contained in:
@@ -52,7 +52,6 @@ class Acl extends Base
|
||||
'category' => '*',
|
||||
'project' => array('edit', 'update', 'exporttasks', 'exportdailyprojectsummary', 'share', 'integration', 'users', 'alloweverybody', 'allow', 'setowner', 'revoke', 'duplicate', 'disable', 'enable'),
|
||||
'swimlane' => '*',
|
||||
'task' => array('remove'),
|
||||
);
|
||||
|
||||
/**
|
||||
|
||||
@@ -198,7 +198,7 @@ class ProjectPermission extends Base
|
||||
->table(self::TABLE)
|
||||
->eq('project_id', $project_id)
|
||||
->eq('user_id', $user_id)
|
||||
->update(array('is_owner' => $is_owner));
|
||||
->update(array('is_owner' => (int) $is_owner));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -20,7 +20,7 @@ class TaskPermission extends Base
|
||||
*/
|
||||
public function canRemoveTask(array $task)
|
||||
{
|
||||
if ($this->userSession->isAdmin()) {
|
||||
if ($this->userSession->isAdmin() || $this->projectPermission->isManager($task['project_id'], $this->userSession->getId())) {
|
||||
return true;
|
||||
}
|
||||
else if (isset($task['creator_id']) && $task['creator_id'] == $this->userSession->getId()) {
|
||||
|
||||
Reference in New Issue
Block a user