perf: 支持管理自己创建的标签

This commit is contained in:
kuaifan
2025-07-08 06:50:43 +08:00
parent 074ccc8aab
commit a15b29122e
7 changed files with 59 additions and 19 deletions

View File

@@ -3032,11 +3032,14 @@ class ProjectController extends AbstractController
'color' => $color,
'userid' => $user->userid
];
$project = Project::userProject($projectId, true, $id > 0 ? true : null);
$project = Project::userProject($projectId);
if ($id > 0) {
$tag = ProjectTag::where('id', $id)
->where('project_id', $projectId)
->first();
if (!$project->owner && $tag->userid != $user->userid) {
return Base::retError('没有权限修改标签');
}
if (!$tag) {
return Base::retError('标签不存在或已被删除');
}