1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-06-26 12:23:06 +08:00

1.修正获取answer权限判断问题

2.order接口补充缺失权限判断
This commit is contained in:
koogua 2021-10-09 09:47:40 +08:00
parent 925f2e98dd
commit ccc1e65505
3 changed files with 6 additions and 2 deletions

View File

@ -35,7 +35,7 @@ class AnswerController extends Controller
$this->notFound(); $this->notFound();
} }
$approved = $answer['published'] != AnswerModel::PUBLISH_APPROVED; $approved = $answer['published'] == AnswerModel::PUBLISH_APPROVED;
$owned = $answer['me']['owned'] == 1; $owned = $answer['me']['owned'] == 1;
if (!$approved && !$owned) { if (!$approved && !$owned) {

View File

@ -33,6 +33,10 @@ class OrderController extends Controller
$this->notFound(); $this->notFound();
} }
if ($order['me']['owned'] == 0) {
$this->forbidden();
}
return $this->jsonSuccess(['order' => $order]); return $this->jsonSuccess(['order' => $order]);
} }

View File

@ -61,7 +61,7 @@ class AnswerController extends Controller
$this->notFound(); $this->notFound();
} }
$approved = $answer['published'] != AnswerModel::PUBLISH_APPROVED; $approved = $answer['published'] == AnswerModel::PUBLISH_APPROVED;
$owned = $answer['me']['owned'] == 1; $owned = $answer['me']['owned'] == 1;
if (!$approved && !$owned) { if (!$approved && !$owned) {