3 ~ Licensed under the Apache License, Version 2.0 (the "License");
4 ~ you may not use this file except in compliance with the License.
5 ~ You may obtain a copy of the License at
7 ~ http://www.apache.org/licenses/LICENSE-2.0
9 ~ Unless required by applicable law or agreed to in writing, software
10 ~ distributed under the License is distributed on an "AS IS" BASIS,
11 ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 ~ See the License for the specific language governing permissions and
13 ~ limitations under the License.
16 <%@ taglib prefix="s" uri="/struts-tags"%>
17 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
18 <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
21 <s:i18n name="org.apache.archiva.redback.struts2.default">
23 <title><s:text name="assignments.page.title"/></title>
28 <h2><s:text name="assignments.section.title"/></h2>
31 <table border="1" cellspacing="2" cellpadding="3" width="100%">
32 <s:label label="%{getText('username')}" name="principal"/>
33 <s:label label="%{getText('full.name')}" name="user.fullName"/>
34 <s:label label="%{getText('email')}" name="user.email"/>
38 <!--<h3><s:text name="assignments.available.roles"/></h3>-->
40 <s:form action="addRolesToUser" namespace="/security" name="addRoles">
41 <s:hidden name="principal"/>
42 <s:hidden name="addRolesButton" value="true"/>
45 <s:iterator id="application" value="applicationRoleDetails">
47 <h3><c:out value="${application.name}" /></h3>
48 <c:if test="${!empty application.description}">
49 <p><i><c:out value="${application.description}" /></i></p>
52 <c:if test="${!empty assignedRoles}">
54 <h5><s:text name="assignments.assigned.roles"/></h5>
56 <s:iterator id="assignedRole" value="assignedRoles">
57 <s:checkbox label="%{assignedRole}" name="addNDSelectedRoles" fieldValue="%{assignedRole}"/>
62 <c:if test="${!empty availableRoles}">
63 <h5><s:text name="assignments.available.roles"/></h5>
65 <s:iterator id="availableRole" value="availableRoles">
66 <s:checkbox label="%{availableRole}" name="addNDSelectedRoles" value="false" fieldValue="%{availableRole}"/>
71 <c:if test="${!empty table}">
72 <h5><s:text name="assignments.resource.roles"/></h5>
76 <s:iterator id="column" value="tableHeader">
77 <td>${column.namePrefix}</td>
81 <c:forEach var="row" items="${table}">
83 <c:forEach var="column" items="${row}">
86 <c:when test="${column.label}">
87 <td>${column.name}</td>
89 <c:when test="${column.assigned}">
92 <input type="checkbox" name="addDSelectedRoles" value="${column.name}" checked="checked"/>
96 <c:when test="${column.effectivelyAssigned}">
99 <input type="checkbox" name="addDSelectedRoles" value="${column.name}" disabled="disabled"/>
106 <input type="checkbox" name="addDSelectedRoles" value="${column.name}"/>
119 <h4>Global Roles</h4>
120 <s:checkboxlist list="nondynamicroles" name="addNDSelectedRoles" value="NDRoles" theme="redback"/>
123 <h4>Resource Roles</h4>
125 <c:when test="${!empty dynamicroles}">
126 <c:set var="numtemplates" value="0"/>
130 <s:iterator id="template" value="templates">
131 <td>${template.namePrefix}</td>
132 <c:set var="numtemplates" value="${numtemplates + 1}"/>
136 <c:set var="count" value="0"/>
137 <s:iterator id="dynamicrole" value="dynamicroles" status="row_status">
138 <c:if test="${count == 0}">
139 <td>${dynamicrole.resource}</td>
141 <c:set var="chkbx" value="<input type='checkbox' name='addDSelectedRoles' value='${dynamicrole.name}'/>"/>
142 <s:iterator id="drole" value="DRoles">
143 <c:if test="${(drole == dynamicrole.name)}">
144 <c:set var="chkbx" value="<input type='checkbox' name='addDSelectedRoles' value='${dynamicrole.name}' checked='yes'/>"/>
147 <td><center>${chkbx}</center></td>
148 <c:set var="count" value="${count + 1}"/>
149 <c:if test="${count == numtemplates}">
151 <c:when test="${row_status.last}">
158 <c:set var="count" value="0"/>
164 <p><em><s:text name="assignments.no.roles.to.grant"/></em></p>
169 <s:submit value="%{getText('assignments.submit')}" name="submitRolesButton" theme="simple" />
171 <s:reset type="button" value="%{getText('assignments.reset')}" name="resetRolesButton" theme="simple" />