NIHVIVO-2211 Remove unnecessary check for null IdentifierBundle.
This commit is contained in:
parent
4ccf33f724
commit
cd03621606
1 changed files with 23 additions and 25 deletions
|
@ -30,31 +30,29 @@ public class SelfEditing2RoleIdentifierFactory implements
|
||||||
public IdentifierBundle getIdentifierBundle(ServletRequest request,
|
public IdentifierBundle getIdentifierBundle(ServletRequest request,
|
||||||
HttpSession session, ServletContext context) {
|
HttpSession session, ServletContext context) {
|
||||||
IdentifierBundle whoToAuth = RequestIdentifiers.getIdBundleForRequest(request);
|
IdentifierBundle whoToAuth = RequestIdentifiers.getIdBundleForRequest(request);
|
||||||
if( whoToAuth != null ){
|
WebappDaoFactory wdf = (WebappDaoFactory)context.getAttribute("webappDaoFactory");
|
||||||
WebappDaoFactory wdf = (WebappDaoFactory)context.getAttribute("webappDaoFactory");
|
if( wdf == null )
|
||||||
if( wdf == null )
|
return whoToAuth;
|
||||||
return whoToAuth;
|
SelfEditingIdentifierFactory.SelfEditing selfEditing =
|
||||||
SelfEditingIdentifierFactory.SelfEditing selfEditing =
|
SelfEditingIdentifierFactory.getSelfEditingIdentifier(whoToAuth);
|
||||||
SelfEditingIdentifierFactory.getSelfEditingIdentifier(whoToAuth);
|
if( selfEditing != null ){
|
||||||
if( selfEditing != null ){
|
User user = wdf.getUserDao().getUserByURI(selfEditing.getIndividual().getURI());
|
||||||
User user = wdf.getUserDao().getUserByURI(selfEditing.getIndividual().getURI());
|
if( user != null){
|
||||||
if( user != null){
|
String role = user.getRoleURI();
|
||||||
String role = user.getRoleURI();
|
if("role/:50".equals(role)){
|
||||||
if("role/:50".equals(role)){
|
whoToAuth.add( AuthRole.DBA );
|
||||||
whoToAuth.add( AuthRole.DBA );
|
}
|
||||||
}
|
if("role/:4".equals(role)){
|
||||||
if("role/:4".equals(role)){
|
whoToAuth.add( AuthRole.CURATOR);
|
||||||
whoToAuth.add( AuthRole.CURATOR);
|
}
|
||||||
}
|
if("role/:3".equals(role)){
|
||||||
if("role/:3".equals(role)){
|
whoToAuth.add( AuthRole.EDITOR);
|
||||||
whoToAuth.add( AuthRole.EDITOR);
|
}
|
||||||
}
|
if("role/:2".equals(role)){
|
||||||
if("role/:2".equals(role)){
|
whoToAuth.add( AuthRole.USER );
|
||||||
whoToAuth.add( AuthRole.USER );
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
return whoToAuth;
|
return whoToAuth;
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue