diff options
| author | Hunternif <hunternif@gmail.com> | 2025-02-16 19:20:08 +0000 |
|---|---|---|
| committer | Hunternif <hunternif@gmail.com> | 2025-02-16 19:20:08 +0000 |
| commit | 9bbbae62f19fe307b11630cac913a59df2b1c957 (patch) | |
| tree | 0dddabd755529cf2d5e48e4a044b81932144a89c /client | |
| parent | 013055187ab28a483acde00f8390e49a44d8b9e2 (diff) | |
client+server: permission posts:bulk-edit:relations
Diffstat (limited to 'client')
| -rw-r--r-- | client/html/posts_header.tpl | 11 | ||||
| -rw-r--r-- | client/html/posts_page.tpl | 2 | ||||
| -rw-r--r-- | client/js/controllers/post_list_controller.js | 2 |
3 files changed, 9 insertions, 6 deletions
diff --git a/client/html/posts_header.tpl b/client/html/posts_header.tpl index 1e30eb4..311964c 100644 --- a/client/html/posts_header.tpl +++ b/client/html/posts_header.tpl @@ -73,11 +73,12 @@ %><a href class='mousetrap button append close'>Stop editing safety</a><% %></form><% } - %><!--TODO: create permission--><% - %><form class='horizontal bulk-edit bulk-add-relation'><% - %><a href class='mousetrap button append open'>Mass add relation</a><% - %><a href class='mousetrap button append close'>Stop adding relation</a><% - %></form><% + if (ctx.canBulkEditRelations) { + %><form class='horizontal bulk-edit bulk-add-relation'><% + %><a href class='mousetrap button append open'>Mass add relation</a><% + %><a href class='mousetrap button append close'>Stop adding relation</a><% + %></form><% + } if (ctx.canBulkDelete) { %><form class='horizontal bulk-edit bulk-edit-delete'><% %><a href class='mousetrap button append open'>Mass delete</a><% diff --git a/client/html/posts_page.tpl b/client/html/posts_page.tpl index bbf6a2d..524af82 100644 --- a/client/html/posts_page.tpl +++ b/client/html/posts_page.tpl @@ -42,7 +42,7 @@ <a href class='tag-flipper'> </a> <% } %> - <% if (ctx.parameters && ctx.parameters.relations) { %> + <% if (ctx.canBulkEditRelations && ctx.parameters && ctx.parameters.relations) { %> <a href class='relation-flipper'> </a> <% } %> diff --git a/client/js/controllers/post_list_controller.js b/client/js/controllers/post_list_controller.js index 9e5d6d5..af0fa33 100644 --- a/client/js/controllers/post_list_controller.js +++ b/client/js/controllers/post_list_controller.js @@ -49,6 +49,7 @@ class PostListController { canBulkEditTags: api.hasPrivilege("posts:bulk-edit:tags"), canBulkEditSafety: api.hasPrivilege("posts:bulk-edit:safety"), canViewMetrics: api.hasPrivilege("metrics:list"), + canBulkEditRelations: api.hasPrivilege("posts:bulk-edit:relations"), canBulkDelete: api.hasPrivilege("posts:bulk-edit:delete"), bulkEdit: { tags: this._bulkEditTags, @@ -222,6 +223,7 @@ class PostListController { tags: this._bulkEditTags, relations: this._ctx.parameters.relations, }, + canBulkEditRelations: api.hasPrivilege("posts:bulk-edit:relations"), canBulkDelete: api.hasPrivilege("posts:bulk-edit:delete"), bulkEdit: { tags: this._bulkEditTags, |