client/auth: fix masstag privilege bypass
Visiting mass-tag URL directly ignored masstag privileges and showed tag/untag controls (although didn't show the controls in the header). After this change, bypassing mass tag privileges got a little bit harder. (It's still possible for the user to talk directly to the API after all.)
This commit is contained in:
parent
1e9ee0838a
commit
4ca7c49239
2 changed files with 2 additions and 1 deletions
|
@ -35,7 +35,7 @@
|
|||
</span>
|
||||
<% } %>
|
||||
</a>
|
||||
<% if (ctx.parameters && ctx.parameters.tag) { %>
|
||||
<% if (ctx.canMassTagg && ctx.parameters && ctx.parameters.tag) { %>
|
||||
<a href data-post-id='<%= post.id %>' class='masstag'>
|
||||
</a>
|
||||
<% } %>
|
||||
|
|
|
@ -48,6 +48,7 @@ class PostListController {
|
|||
pageRenderer: pageCtx => {
|
||||
Object.assign(pageCtx, {
|
||||
canViewPosts: api.hasPrivilege('posts:view'),
|
||||
canMassTag: api.hasPrivilege('tags:masstag'),
|
||||
massTagTags: this._massTagTags,
|
||||
});
|
||||
const view = new PostsPageView(pageCtx);
|
||||
|
|
Loading…
Reference in a new issue