user-menu.tag 2 KB
Newer Older
Maxym Borodenko's avatar
Maxym Borodenko committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="security" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ attribute name="user" required="true" description="User" rtexprvalue="true" type="java.lang.Object" %>

<security:authorize access="isAuthenticated()">
    <li class="dropdown">
        <a class="menu-link" href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
            <spring:message code="user.pulldown.heading" arguments="${user.fullName}" />
            <span class="caret"></span>
        </a>
        <ul class="dropdown-menu pull-left">
            <li>
                <a href="<c:url value="/profile/${user.uuid}" />"><spring:message code="user.pulldown.profile" /></a>
            </li>
            <li>
                <a id="logout1" onclick="document.getElementById('logoutForm').submit();"><spring:message code="user.pulldown.logout" /></a>
            </li>

            <security:authorize access="hasRole('ADMINISTRATOR')">
                <li role="separator" class="divider"></li>
                <li>
                    <a href="<c:url value="/admin/" />"><spring:message code="user.pulldown.administration" /></a>
                </li>
                <li>
                    <a href="<c:url value="/admin/users/" />"><spring:message code="user.pulldown.users" /></a>
                </li>
                <li>
                    <a href="<c:url value="/team" />"><spring:message code="user.pulldown.teams" /></a>
                </li>
                <li>
                    <a href="<c:url value="/admin/oauth-clients/" />"><spring:message code="user.pulldown.oauth-clients" /></a>
                </li>
            </security:authorize>
        </ul>
36
37
38
39
    </li>    
	<form id="logoutForm" action="/logout" method="post">
		<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}" />
	</form>
Maxym Borodenko's avatar
Maxym Borodenko committed
40
</security:authorize>