}
public UserIdentity newUserIdentity(Subject subject, Principal userPrincipal, String[] roles) {
if (subject != null) {
AccessControlContext acc = ContextManager.registerSubjectShort(subject, userPrincipal, roles == null? null: Arrays.asList(roles));
return new GeronimoUserIdentity(subject, userPrincipal, acc);
}
return new GeronimoUserIdentity(null, null, defaultAcc);
}