瀏覽代碼

Update Models\PM\PPost

Update rules.
Visman 4 年之前
父節點
當前提交
5761c265ee
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      app/Models/PM/PPost.php

+ 2 - 2
app/Models/PM/PPost.php

@@ -97,7 +97,7 @@ class PPost extends DataModel
      */
      */
     protected function getcanDelete(): bool
     protected function getcanDelete(): bool
     {
     {
-        return ! $this->parent->closed
+        return $this->parent->actionsAllowed
             && $this->poster_id === $this->c->user->id
             && $this->poster_id === $this->c->user->id
             && $this->id !== $this->parent->first_post_id
             && $this->id !== $this->parent->first_post_id
             && $this->posted > $this->parent->{"{$this->parent->zt}_visit"};
             && $this->posted > $this->parent->{"{$this->parent->zt}_visit"};
@@ -124,7 +124,7 @@ class PPost extends DataModel
      */
      */
     protected function getcanEdit(): bool
     protected function getcanEdit(): bool
     {
     {
-        return ! $this->parent->closed
+        return $this->parent->actionsAllowed
             && $this->poster_id === $this->c->user->id
             && $this->poster_id === $this->c->user->id
             && $this->posted > $this->parent->{"{$this->parent->zt}_visit"};
             && $this->posted > $this->parent->{"{$this->parent->zt}_visit"};
     }
     }