Skip to content

Node.js based forum software built for the modern web

first pass at #773

Julian Lambafc8caaf5e1
diff --git a/public/templates/category.tpl b/public/templates/category.tpl
index 8dd78f12ed..8ba94b3788 100644
--- a/public/templates/category.tpl
+++ b/public/templates/category.tpl
@@ -8,7 +8,9 @@
</ol>
<div>
+ <!-- IF privileges.write -->
<button id="new_post" class="btn btn-primary {show_topic_button}">[[category:new_topic_button]]</button>
+ <!-- ENDIF privileges.write -->
<!-- IF !disableSocialButtons -->
<div class="inline-block pull-right">
<a href="#" id="facebook-share"><i class="fa fa-facebook-square fa-2x"></i></a>&nbsp;
diff --git a/src/routes/api.js b/src/routes/api.js
index b8ab640a90..a6e429453a 100644
--- a/src/routes/api.js
+++ b/src/routes/api.js
@@ -190,6 +190,9 @@ var path = require('path'),
return next(err);
}
+ // Add privilege data to template data
+ data.privileges = privileges;
+
if (data && parseInt(data.disabled, 10) === 0) {
res.json(data);
} else {