subject = (Subject) java.security.AccessController.doPrivileged(
new PrivilegedAction<Object>() {
public Object run(){
Subject tempSubject = new Subject();
tempSubject.getPrincipals().add(new MQUser(tempUser));
tempSubject.getPrincipals().add(new MQGroup(rolestr));
if (rolestr.equals(ADMINGROUP)) {
tempSubject.getPrincipals().add(
new MQAdminGroup(ADMINGROUP));
}
return tempSubject;