return null;
}
private ActionForward checkAccess(ActionMapping mapping, FileSystemForm fileSystemForm, HttpServletRequest request)
throws NoPermissionException {
SessionInfo actualSession = LogonControllerFactory.getInstance().getSessionInfo(request);
SessionInfo session = fileSystemForm.getLaunchSession().getSession();
if (fileSystemForm.getNetworkPlace() != null) {
NetworkPlace resource = fileSystemForm.getNetworkPlace();
// check access for the attributes on the NetworkPlace.
if (resource.isNoDelete() && NO_DELETE.contains(fileSystemForm.getActionTarget())) {
ActionMessages msgs = getErrors(request);
msgs.add(Globals.ERROR_KEY, new BundleActionMessage(NetworkPlacePlugin.MESSAGE_RESOURCES_KEY, "vfs.noDelete.error"));
saveMessages(request, msgs);
return mapping.getInputForward();
}
}
try {
if(fileSystemForm.getLaunchSession().isTracked()) {
LaunchSession.AccessRight accessRight = fileSystemForm.getLaunchSession().checkAccessRights(null, actualSession);
if (accessRight == LaunchSession.USER_ACCESS || isSuperUser(request)) {
fileSystemForm.setReadWrite();
} else if (accessRight == LaunchSession.MANAGEMENT_ACCESS) {
ActionMessages warnings = getWarnings(request);
warnings.add(Constants.REQ_ATTR_WARNINGS, new BundleActionMessage(NetworkPlacePlugin.MESSAGE_RESOURCES_KEY, "vfs.manageOnly.warning"));
saveWarnings(request, warnings);
}
}
return null;
} catch (Exception e) {
log.error("Failed to test if user has access to resource. Denying", e);
throw new NoPermissionException("Permission denied.", session.getUser(), NetworkPlacePlugin.NETWORK_PLACE_RESOURCE_TYPE);
}
}