mirror of
https://github.com/rr-/szurubooru.git
synced 2025-07-17 08:26:24 +00:00
Fixed post list disregarding viewPosts privilege
This commit is contained in:
@ -5,17 +5,23 @@ App.Presenters.GlobalCommentListPresenter = function(
|
||||
_,
|
||||
jQuery,
|
||||
util,
|
||||
auth,
|
||||
promise,
|
||||
pagerPresenter,
|
||||
topNavigationPresenter) {
|
||||
|
||||
var $el;
|
||||
var privileges;
|
||||
var templates = {};
|
||||
|
||||
function init(params, loaded) {
|
||||
$el = jQuery('#content');
|
||||
topNavigationPresenter.select('comments');
|
||||
|
||||
privileges = {
|
||||
canViewPosts: auth.hasPrivilege(auth.privileges.viewPosts),
|
||||
};
|
||||
|
||||
promise.wait(
|
||||
util.promiseTemplate('global-comment-list'),
|
||||
util.promiseTemplate('global-comment-list-item'),
|
||||
@ -69,6 +75,7 @@ App.Presenters.GlobalCommentListPresenter = function(
|
||||
util: util,
|
||||
post: post,
|
||||
postTemplate: templates.post,
|
||||
canViewPosts: privileges.canViewPosts,
|
||||
}) + '</li>');
|
||||
|
||||
util.loadImagesNicely($post.find('img'));
|
||||
@ -95,4 +102,4 @@ App.Presenters.GlobalCommentListPresenter = function(
|
||||
|
||||
};
|
||||
|
||||
App.DI.register('globalCommentListPresenter', ['_', 'jQuery', 'util', 'promise', 'pagerPresenter', 'topNavigationPresenter'], App.Presenters.GlobalCommentListPresenter);
|
||||
App.DI.register('globalCommentListPresenter', ['_', 'jQuery', 'util', 'auth', 'promise', 'pagerPresenter', 'topNavigationPresenter'], App.Presenters.GlobalCommentListPresenter);
|
||||
|
@ -29,6 +29,7 @@ App.Presenters.PostListPresenter = function(
|
||||
params.query = params.query || {};
|
||||
|
||||
privileges.canMassTag = auth.hasPrivilege(auth.privileges.massTag);
|
||||
privileges.canViewPosts = auth.hasPrivilege(auth.privileges.viewPosts);
|
||||
|
||||
promise.wait(
|
||||
util.promiseTemplate('post-list'),
|
||||
@ -165,6 +166,7 @@ App.Presenters.PostListPresenter = function(
|
||||
util: util,
|
||||
query: params.query,
|
||||
post: post,
|
||||
canViewPosts: privileges.canViewPosts,
|
||||
}) + '</li>');
|
||||
$post.data('post', post);
|
||||
util.loadImagesNicely($post.find('img'));
|
||||
|
Reference in New Issue
Block a user