mirror of
https://github.com/flarum/core.git
synced 2025-08-05 07:57:46 +02:00
feat(likes): Option to prevent users liking their own posts (#3534)
* Option to prevent users liking their own posts * test: user can only like own post if setting ON Co-authored-by: Sami Mazouz <ilyasmazouz@gmail.com>
This commit is contained in:
@@ -1,12 +1,20 @@
|
||||
import app from 'flarum/admin/app';
|
||||
|
||||
app.initializers.add('flarum-likes', () => {
|
||||
app.extensionData.for('flarum-likes').registerPermission(
|
||||
{
|
||||
icon: 'far fa-thumbs-up',
|
||||
label: app.translator.trans('flarum-likes.admin.permissions.like_posts_label'),
|
||||
permission: 'discussion.likePosts',
|
||||
},
|
||||
'reply'
|
||||
);
|
||||
app.extensionData
|
||||
.for('flarum-likes')
|
||||
.registerPermission(
|
||||
{
|
||||
icon: 'far fa-thumbs-up',
|
||||
label: app.translator.trans('flarum-likes.admin.permissions.like_posts_label'),
|
||||
permission: 'discussion.likePosts',
|
||||
},
|
||||
'reply'
|
||||
)
|
||||
.registerSetting({
|
||||
setting: 'flarum-likes.like_own_post',
|
||||
type: 'bool',
|
||||
label: app.translator.trans('flarum-likes.admin.settings.like_own_posts_label'),
|
||||
help: app.translator.trans('flarum-likes.admin.settings.like_own_posts_help'),
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user