* Optimize code.

This commit is contained in:
liumengyi
2024-04-29 16:22:14 +08:00
parent fd0b3de78e
commit 4663d45716
+2 -4
View File
@@ -2140,10 +2140,8 @@ class taskModel extends model
{
$action = strtolower($action);
/* 执行不可修改的话,任务也不可修改。 */
global $dao;
$execution = $dao->findById($task->execution)->from(TABLE_EXECUTION)->fetch();
if(!common::canModify('execution', $execution)) return false;
/* 任务不可修改的话,则无法进行操作。 */
if(!common::canModify('task', $task)) return false;
/* 父任务只能编辑和创建子任务。 Parent task only can edit task and create children. */
if((!empty($task->isParent) || $task->parent < 0) && !in_array($action, array('edit', 'batchcreate', 'cancel'))) return false;