1
0
mirror of synced 2026-08-05 09:47:05 +00:00

Handle null Authentication.getAuthorities() in AuthorizeTag.

This commit is contained in:
Ben Alex
2005-03-27 06:36:41 +00:00
parent 8e6305ae81
commit 684d5bc10e
2 changed files with 12 additions and 1 deletions
@@ -25,7 +25,12 @@ import org.springframework.util.StringUtils;
import org.springframework.web.util.ExpressionEvaluationUtils;
import java.util.*;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.Tag;
@@ -130,6 +135,11 @@ public class AuthorizeTag extends TagSupport {
return Collections.EMPTY_LIST;
}
if ((null == currentUser.getAuthorities())
|| (currentUser.getAuthorities().length < 1)) {
return Collections.EMPTY_LIST;
}
Collection granted = Arrays.asList(currentUser.getAuthorities());
return granted;