1
0
mirror of https://github.com/flarum/core.git synced 2025-07-19 15:51:16 +02:00

Give author permission to delete discussion if there are no replies

Forgot to commit this part in 64e5d50533
:3
This commit is contained in:
Toby Zerner
2015-06-24 09:13:54 +09:30
parent a09c86e42d
commit b4dcc02520

View File

@@ -247,5 +247,12 @@ class CoreServiceProvider extends ServiceProvider
// @todo add limitations to time etc. according to a config setting // @todo add limitations to time etc. according to a config setting
} }
}); });
Discussion::allow('delete', function ($discussion, $user) {
if ($discussion->start_user_id == $user->id && $discussion->participants_count == 1) {
return true;
// @todo add limitations to time etc. according to a config setting
}
});
} }
} }