Author: chathura
Date: Wed Jan 30 01:50:54 2008
New Revision: 13171
Log:
Restriction for actions based on the permissions of the user.
Modified:
trunk/registry/modules/webapps/src/main/webapp/admin/user.jsp
Modified: trunk/registry/modules/webapps/src/main/webapp/admin/user.jsp
==============================================================================
--- trunk/registry/modules/webapps/src/main/webapp/admin/user.jsp
(original)
+++ trunk/registry/modules/webapps/src/main/webapp/admin/user.jsp Wed Jan
30 01:50:54 2008
@@ -1,6 +1,7 @@
<%@ page import="org.wso2.registry.web.actions.UserDetailsAction" %>
<%@ page import="org.wso2.registry.web.UIConstants" %>
<%@ page import="java.util.Iterator" %>
+<%@ page import="org.wso2.registry.RegistryConstants" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
@@ -135,14 +136,16 @@
Iterator iRoles = userDetailsAction.getAllRoles().iterator();
while (iRoles.hasNext()) {
String roleName = (String) iRoles.next();
+
+ if (!RegistryConstants.EVERYONE_ROLE.equals(roleName)) {
%>
<option value="<%=roleName%>"><%=roleName%></option>
- <% } %>
+ <% }} %>
</select>
<input type="submit" class="button" value="Add"/>
</form>
<% } %>
-
+
<h3>Available roles to <%=userDetailsAction.getUserName()%></h3>
<table cellpadding="0" cellspacing="0" border="0" style="width:600px;"
class="data-table">
<tr>
@@ -155,7 +158,7 @@
while (iUserRoles.hasNext()) {
String userRole = (String) iUserRoles.next();
%>
- <tr><td><%=userRole%></td><td><a
href="/wso2registry/system/removeUserFromRole?user=<%=userDetailsAction.getUserName()%>&role=<%=userRole%>"><img
src="/wso2registry/admin/images/icon-trash.gif" border="0" /></a></td></tr>
+ <tr><td><%=userRole%></td><td><% if
(!RegistryConstants.EVERYONE_ROLE.equals(userRole) &&
userDetailsAction.isUserAdmin()) { %><a
href="/wso2registry/system/removeUserFromRole?user=<%=userDetailsAction.getUserName()%>&role=<%=userRole%>"><img
src="/wso2registry/admin/images/icon-trash.gif" border="0" /></a><% }
%></td></tr>
<% } %>
</table>
_______________________________________________
Registry-dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/registry-dev