mirror of
https://github.com/wassname/talk.git
synced 2026-08-13 12:40:11 +08:00
Merge branch 'master' into user-sort
Conflicts: client/coral-admin/src/reducers/moderation.js client/coral-embed-stream/src/actions/stream.js client/coral-embed-stream/src/components/Stream.js client/coral-framework/components/Slot.js plugin-api/beta/client/utils/index.js test/server/routes/api/account/index.js
This commit is contained in:
@@ -24,13 +24,16 @@ const User = {
|
||||
},
|
||||
comments({id}, {query}, {loaders: {Comments}, user}) {
|
||||
|
||||
// If the user is not an admin, only return comment list for the owner of
|
||||
// the comments.
|
||||
if (user && (user.can(SEARCH_OTHERS_COMMENTS) || user.id === id)) {
|
||||
return Comments.getByQuery(Object.assign({}, query, {author_id: id}));
|
||||
// If there is no user, or there is a user, but they are requesting someone
|
||||
// else's comments, and they aren't allowed, don't return then anything!
|
||||
if (!user || (user.id !== id && !user.can(SEARCH_OTHERS_COMMENTS))) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return null;
|
||||
// Set the author id on the query.
|
||||
query.author_id = id;
|
||||
|
||||
return Comments.getByQuery(query);
|
||||
},
|
||||
profiles({profiles}, _, {user}) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user