Fix 403 if user has no access to Query but has access to a Calendar and clicks it

This commit is contained in:
Aurora Lahtela 2023-10-15 17:15:38 +03:00
parent 499d82139a
commit fe59fa5a66

View File

@ -111,7 +111,9 @@ public class QueryJSONResolver implements Resolver {
@Override
public boolean canAccess(Request request) {
WebUser user = request.getUser().orElse(new WebUser(""));
return user.hasPermission(WebPermission.ACCESS_QUERY);
return user.hasPermission(WebPermission.ACCESS_QUERY)
|| user.hasPermission(WebPermission.PAGE_NETWORK_OVERVIEW_GRAPHS_CALENDAR)
|| user.hasPermission(WebPermission.PAGE_SERVER_ONLINE_ACTIVITY_GRAPHS_CALENDAR);
}
@GET