From 9bbbae62f19fe307b11630cac913a59df2b1c957 Mon Sep 17 00:00:00 2001 From: Hunternif Date: Sun, 16 Feb 2025 19:20:08 +0000 Subject: client+server: permission posts:bulk-edit:relations --- client/html/posts_header.tpl | 11 ++++++----- client/html/posts_page.tpl | 2 +- client/js/controllers/post_list_controller.js | 2 ++ 3 files changed, 9 insertions(+), 6 deletions(-) (limited to 'client') 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 @@ %>Stop editing safety<% %><% } - %><% - %>
<% - %>Mass add relation<% - %>Stop adding relation<% - %>
<% + if (ctx.canBulkEditRelations) { + %>
<% + %>Mass add relation<% + %>Stop adding relation<% + %>
<% + } if (ctx.canBulkDelete) { %>
<% %>Mass delete<% 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 @@ <% } %> - <% if (ctx.parameters && ctx.parameters.relations) { %> + <% if (ctx.canBulkEditRelations && ctx.parameters && ctx.parameters.relations) { %> <% } %> 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, -- cgit v1.3