Skip to content

Commit

Permalink
fix(动态): 权限判断条件编写错误,导致有权限的人无法删除,无权限的人可以删除
Browse files Browse the repository at this point in the history
  • Loading branch information
medz committed Nov 26, 2018
1 parent 03598dc commit f3ce698
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/slimkit-plus-feed/src/API2/FeedController.php
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ public function destroy(
FeedModel $feed
) {
$user = $request->user();
if ($user->id !== $feed->user_id || ! $user->ability('[feed] Delete Feed')) {
if ($user->id !== $feed->user_id && ! $user->ability('[feed] Delete Feed')) {
return $response->json(['message' => '你没有权限删除动态'])->setStatusCode(403);
}
$feed->getConnection()->transaction(function () use ($feed, $user) {
Expand Down

0 comments on commit f3ce698

Please sign in to comment.