提交 84231584 编写于 作者: J Jesse Glick

An SCM-only user has no groups, so do not throw an undocumented exception looking them up.

… hudson.ExpressionFactory2$JexlExpression evaluate
WARNING: Caught exception evaluating: it.authorities in /user/demo/. Reason: java.lang.reflect.InvocationTargetException
java.lang.reflect.InvocationTargetException
	at …
Caused by: org.acegisecurity.userdetails.UsernameNotFoundException: demo
	at hudson.security.SecurityRealm$None$2.loadUserByUsername(SecurityRealm.java:494)
	at jenkins.security.ImpersonatingUserDetailsService.loadUserByUsername(ImpersonatingUserDetailsService.java:32)
	at hudson.model.User.impersonate(User.java:282)
	at hudson.model.User.getAuthorities(User.java:769)
	... 93 more
上级 1941f098
......@@ -802,7 +802,14 @@ public class User extends AbstractModelObject implements AccessControlled, Descr
return Collections.emptyList();
}
List<String> r = new ArrayList<String>();
for (GrantedAuthority a : impersonate().getAuthorities()) {
Authentication authentication;
try {
authentication = impersonate();
} catch (UsernameNotFoundException x) {
LOGGER.log(Level.FINE, "cannot look up authorities for " + id, x);
return Collections.emptyList();
}
for (GrantedAuthority a : authentication.getAuthorities()) {
if (a.equals(SecurityRealm.AUTHENTICATED_AUTHORITY)) {
continue;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册