summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--client/html/posts_header.tpl11
-rw-r--r--client/html/posts_page.tpl2
-rw-r--r--client/js/controllers/post_list_controller.js2
-rw-r--r--server/config.yaml.dist3
4 files changed, 11 insertions, 7 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,
diff --git a/server/config.yaml.dist b/server/config.yaml.dist
index b373502..f3cc5de 100644
--- a/server/config.yaml.dist
+++ b/server/config.yaml.dist
@@ -102,6 +102,7 @@ privileges:
'posts:reverse_search': regular
'posts:view': anonymous
'posts:view:featured': anonymous
+ 'posts:view:similar': regular
'posts:view:sketchy': regular
'posts:view:unsafe': regular
'posts:edit:content': power
@@ -119,7 +120,7 @@ privileges:
'posts:favorite': regular
'posts:bulk-edit:tags': power
'posts:bulk-edit:safety': power
- 'posts:view:similar': regular
+ 'posts:bulk-edit:relations': power
'posts:bulk-edit:delete': power
'tags:create': regular