summaryrefslogtreecommitdiff
path: root/app/Api/Procedure
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-07-31 14:44:18 -0400
committerFrederic Guillot <fred@kanboard.net>2016-07-31 14:44:18 -0400
commitf5abf6c94e1cdf3120fce50eed55076c9caa9e6f (patch)
treefaca3516f10f237ae3df9492c0c2506893f2cb39 /app/Api/Procedure
parent98efcf21e355ed6ac3827058b99df86ca67c75bb (diff)
parent27a166f750df78e65e87f432219827656aa09494 (diff)
Merge pull-request #2533
Diffstat (limited to 'app/Api/Procedure')
-rw-r--r--app/Api/Procedure/TaskProcedure.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/app/Api/Procedure/TaskProcedure.php b/app/Api/Procedure/TaskProcedure.php
index 8661deef..59075b13 100644
--- a/app/Api/Procedure/TaskProcedure.php
+++ b/app/Api/Procedure/TaskProcedure.php
@@ -6,6 +6,7 @@ use Kanboard\Api\Authorization\ProjectAuthorization;
use Kanboard\Api\Authorization\TaskAuthorization;
use Kanboard\Filter\TaskProjectFilter;
use Kanboard\Model\TaskModel;
+use Kanboard\Model\TaskMetadataModel;
/**
* Task API controller
@@ -15,6 +16,30 @@ use Kanboard\Model\TaskModel;
*/
class TaskProcedure extends BaseProcedure
{
+ public function getTaskMetadata($task_id)
+ {
+ TaskAuthorization::getInstance($this->container)->check($this->getClassName(), 'getTask', $task_id);
+ return $this->taskMetadataModel->getAll($task_id);
+ }
+
+ public function getTaskMetadataByName($task_id, $name)
+ {
+ TaskAuthorization::getInstance($this->container)->check($this->getClassName(), 'getTask', $task_id);
+ return $this->taskMetadataModel->get($task_id, $name);
+ }
+
+ public function saveTaskMetadata($task_id, array $values)
+ {
+ TaskAuthorization::getInstance($this->container)->check($this->getClassName(), 'updateTask', $task_id);
+ return $this->taskMetadataModel->save($task_id, $values);
+ }
+
+ public function removeTaskMetadata($task_id, $name)
+ {
+ TaskAuthorization::getInstance($this->container)->check($this->getClassName(), 'updateTask', $task_id);
+ return $this->taskMetadataModel->remove($task_id, $name);
+ }
+
public function searchTasks($project_id, $query)
{
ProjectAuthorization::getInstance($this->container)->check($this->getClassName(), 'searchTasks', $project_id);