Connect - Report Listing Error
On a connect server, remove all conservation areas. Upload a single conservation area, create a new connect user with CA Admin access to this CA. Log in as this new user, and go to the reports page. Nothing loads.
The problem is that if a user CA Admin access to any CA on the server, the code for reports automatically assumes that it has CCAA access and tried to load CCAA Conservation Area from the database, which doesn't exist (so you end up with a null pointer exception). I don't think the code should be doing this - if should look to see if the user has CCAA permissions for reports.
Workaround: upload an empty CCAA to connect
Report API:
The problem is that if a user CA Admin access to any CA on the server, the code for reports automatically assumes that it has CCAA access and tried to load CCAA Conservation Area from the database, which doesn't exist (so you end up with a null pointer exception). I don't think the code should be doing this - if should look to see if the user has CCAA permissions for reports.
Workaround: upload an empty CCAA to connect
Report API:
boolean atleastonecaadmin = SecurityManager.INSTANCE.canAccessAtLeastOneResouce(s, request.getUserPrincipal().getName(), CaAdminAccountAction.KEY);
if (atleastonecaadmin) {
caUuids.add(ConservationArea.MULTIPLE_CA);
}
Leave a comment