diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/auth/identifier/SelfEditing2RoleIdentifierFactory.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/auth/identifier/SelfEditing2RoleIdentifierFactory.java index 203726b44..c521821b8 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/auth/identifier/SelfEditing2RoleIdentifierFactory.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/auth/identifier/SelfEditing2RoleIdentifierFactory.java @@ -30,31 +30,29 @@ public class SelfEditing2RoleIdentifierFactory implements public IdentifierBundle getIdentifierBundle(ServletRequest request, HttpSession session, ServletContext context) { IdentifierBundle whoToAuth = RequestIdentifiers.getIdBundleForRequest(request); - if( whoToAuth != null ){ - WebappDaoFactory wdf = (WebappDaoFactory)context.getAttribute("webappDaoFactory"); - if( wdf == null ) - return whoToAuth; - SelfEditingIdentifierFactory.SelfEditing selfEditing = - SelfEditingIdentifierFactory.getSelfEditingIdentifier(whoToAuth); - if( selfEditing != null ){ - User user = wdf.getUserDao().getUserByURI(selfEditing.getIndividual().getURI()); - if( user != null){ - String role = user.getRoleURI(); - if("role/:50".equals(role)){ - whoToAuth.add( AuthRole.DBA ); - } - if("role/:4".equals(role)){ - whoToAuth.add( AuthRole.CURATOR); - } - if("role/:3".equals(role)){ - whoToAuth.add( AuthRole.EDITOR); - } - if("role/:2".equals(role)){ - whoToAuth.add( AuthRole.USER ); - } - } - } - } + WebappDaoFactory wdf = (WebappDaoFactory)context.getAttribute("webappDaoFactory"); + if( wdf == null ) + return whoToAuth; + SelfEditingIdentifierFactory.SelfEditing selfEditing = + SelfEditingIdentifierFactory.getSelfEditingIdentifier(whoToAuth); + if( selfEditing != null ){ + User user = wdf.getUserDao().getUserByURI(selfEditing.getIndividual().getURI()); + if( user != null){ + String role = user.getRoleURI(); + if("role/:50".equals(role)){ + whoToAuth.add( AuthRole.DBA ); + } + if("role/:4".equals(role)){ + whoToAuth.add( AuthRole.CURATOR); + } + if("role/:3".equals(role)){ + whoToAuth.add( AuthRole.EDITOR); + } + if("role/:2".equals(role)){ + whoToAuth.add( AuthRole.USER ); + } + } + } return whoToAuth; } } \ No newline at end of file