Index: lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/service/SimpleRepository.java =================================================================== RCS file: /usr/local/cvsroot/lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/service/SimpleRepository.java,v diff -u -r1.13 -r1.14 --- lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/service/SimpleRepository.java 17 Sep 2006 06:16:10 -0000 1.13 +++ lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/service/SimpleRepository.java 6 Nov 2007 05:47:54 -0000 1.14 @@ -126,11 +126,16 @@ */ private Integer getCurrentUserId() throws AccessDeniedException { HttpSession ss = SessionManager.getSession(); - UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER); - if ( user == null ) { - throw new AccessDeniedException("Cannot get user details for content repository. User may not be logged in."); + if ( ss != null ) { + log.debug("Getting user from UserDTO - must have come from a normal request"); + UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER); + if ( user == null ) { + throw new AccessDeniedException("Cannot get user details for content repository. User may not be logged in."); + } + return user.getUserID(); + } else { + throw new AccessDeniedException("Cannot get user details for content repository. No session found - user not logged in or the webservice callĀ has not set up the session details."); } - return user.getUserID(); } /** * @param workspaceName