mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-01-04 23:48:42 +01:00
parent
ca89ab70d9
commit
3d3c7289bb
@ -59,12 +59,16 @@ public class PlayersTableJSONResolver implements PageResolver {
|
|||||||
UUID serverUUID = identifiers.getServerUUID(target); // Can throw BadRequestException
|
UUID serverUUID = identifiers.getServerUUID(target); // Can throw BadRequestException
|
||||||
return JSONCache.getOrCache(DataID.PLAYERS, serverUUID, () -> new JSONResponse(jsonFactory.serverPlayersTableJSON(serverUUID)));
|
return JSONCache.getOrCache(DataID.PLAYERS, serverUUID, () -> new JSONResponse(jsonFactory.serverPlayersTableJSON(serverUUID)));
|
||||||
}
|
}
|
||||||
// Assume network
|
// Assume players page
|
||||||
return JSONCache.getOrCache(DataID.PLAYERS, () -> new JSONResponse(jsonFactory.networkPlayersTableJSON()));
|
return JSONCache.getOrCache(DataID.PLAYERS, () -> new JSONResponse(jsonFactory.networkPlayersTableJSON()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isAuthorized(Authentication auth, RequestTarget target) throws WebUserAuthException {
|
public boolean isAuthorized(Authentication auth, RequestTarget target) throws WebUserAuthException {
|
||||||
return auth.getWebUser().getPermLevel() <= 0;
|
if (target.getParameter("server").isPresent()) {
|
||||||
|
return auth.getWebUser().getPermLevel() <= 0;
|
||||||
|
}
|
||||||
|
// Assume players page
|
||||||
|
return auth.getWebUser().getPermLevel() <= 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user