-
-
Notifications
You must be signed in to change notification settings - Fork 881
feat(permission): add delete own posts permission #3784
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
96087d3
72aa975
c57864c
2412417
19239b2
3bbfe46
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -71,6 +71,14 @@ public function edit(User $actor, Post $post) | |||||
| */ | ||||||
| public function hide(User $actor, Post $post) | ||||||
| { | ||||||
| return $this->edit($actor, $post); | ||||||
| if ($post->user_id == $actor->id && (! $post->hidden_at || $post->hidden_user_id == $actor->id) && $actor->can('reply', $post->discussion)) { | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if we should drop the bit about only being able to hide when the discussion is still open 🤔
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried to keep the behavior close to the post-editing one for consistency so that's why that's there! I was wondering if it would be necessary or not.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, not sure, let's keep it as is for now, then we'll see I guess unless other core devs have an opinion on is.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd prefer to keep it. If a user can't participate in a discussion going forward, i don't think they should be able to participate retroactively either. |
||||||
| $allowHiding = $this->settings->get('allow_hide_own_posts'); | ||||||
|
|
||||||
| if ($allowHiding === '-1' | ||||||
| || ($allowHiding === 'reply' && $post->number >= $post->discussion->last_post_number) | ||||||
| || (is_numeric($allowHiding) && $post->created_at->diffInMinutes(new Carbon) < $allowHiding)) { | ||||||
| return $this->allow(); | ||||||
| } | ||||||
| } | ||||||
| } | ||||||
| } | ||||||
Uh oh!
There was an error while loading. Please reload this page.