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:
@@ -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
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user