Merge "Fix authentication exception for list comments with anonymous users"
This commit is contained in:
@@ -57,17 +57,12 @@ public class ListChangeComments implements RestReadView<ChangeResource> {
|
||||
@Override
|
||||
public Response<Map<String, List<CommentInfo>>> apply(ChangeResource rsrc)
|
||||
throws AuthException, PermissionBackendException {
|
||||
if (!rsrc.getUser().isIdentifiedUser()) {
|
||||
throw new AuthException("Authentication required");
|
||||
}
|
||||
/** List change comments does not require authentication */
|
||||
return Response.ok(getAsMap(listComments(rsrc), rsrc));
|
||||
}
|
||||
|
||||
public List<CommentInfo> getComments(ChangeResource rsrc)
|
||||
throws AuthException, PermissionBackendException {
|
||||
if (!rsrc.getUser().isIdentifiedUser()) {
|
||||
throw new AuthException("Authentication required");
|
||||
}
|
||||
public List<CommentInfo> getComments(ChangeResource rsrc) throws PermissionBackendException {
|
||||
/** List change comments does not require authentication */
|
||||
return getAsList(listComments(rsrc), rsrc);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user