Skip to content

Commit 99d30f4

Browse files
Only check authorities if not anonymous
1 parent 9ee5289 commit 99d30f4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/webapp/WEB-INF/jsp/import.jsp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<c:set var="supervisorRoleSuffix" value='<%= "$" + IRoleDefinition.ROLE_DB_SUPERVISOR %>' />
3131
<c:set var="loggedUser" value="<%=SecurityContextHolder.getContext().getAuthentication().getPrincipal()%>" />
3232
<c:set var='dbCreatorRole' value='<%= IRoleDefinition.ROLE_DB_CREATOR %>' />
33-
<c:set var="hasDbCreatorRole" value="false" /><c:forEach var="authority" items="${loggedUser.authorities}"><c:if test="${authority == dbCreatorRole}"><c:set var="hasDbCreatorRole" value="true" /></c:if></c:forEach>
33+
<c:set var="hasDbCreatorRole" value="false" /><c:if test="${'anonymousUser' != loggedUser}"><c:forEach var="authority" items="${loggedUser.authorities}"><c:if test="${authority == dbCreatorRole}"><c:set var="hasDbCreatorRole" value="true" /></c:if></c:forEach></c:if>
3434
<sec:authorize access="hasRole('ROLE_ADMIN')" var="isAdmin"/>
3535
<sec:authorize access="hasRole('ROLE_ANONYMOUS')" var="isAnonymous"/>
3636

0 commit comments

Comments
 (0)