All Downloads are FREE. Search and download functionalities are using the official Maven repository.

web.roles-mgt.server-roles-mgt.jsp Maven / Gradle / Ivy


<%@ page import="org.apache.axis2.context.ConfigurationContext" %>
<%@ page import="org.owasp.encoder.Encode" %>
<%@ page import="org.wso2.carbon.CarbonConstants" %>
<%@ page import="org.wso2.carbon.roles.mgt.ui.ServerRoleManagerClient" %>
<%@ page import="org.wso2.carbon.ui.CarbonUIMessage" %>
<%@ page import="org.wso2.carbon.ui.CarbonUIUtil" %>
<%@ page import="org.wso2.carbon.utils.ServerConstants" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib uri="http://wso2.org/projects/carbon/taglibs/carbontags.jar" prefix="carbon" %>


<%

    String serverURL = CarbonUIUtil.getServerURL(config.getServletContext(), session);
    ConfigurationContext configContext =
            (ConfigurationContext) config.getServletContext().getAttribute(
                    CarbonConstants.CONFIGURATION_CONTEXT);
    String cookie = (String) session.getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);
    ServerRoleManagerClient client;

    String[] defaultServerRoles;
    String[] customServerRoles;

    try {
        client = new ServerRoleManagerClient(configContext, serverURL, cookie);
        defaultServerRoles = client.getServerRoles("Default");
        customServerRoles = client.getServerRoles("Custom");

    } catch (Exception e) {
        CarbonUIMessage uiMsg = new CarbonUIMessage(CarbonUIMessage.ERROR, e.getMessage(), e);
        session.setAttribute(CarbonUIMessage.ID, uiMsg);
%>

<%
        return;
    }
%>







<% if ((defaultServerRoles != null) && (defaultServerRoles.length != 0) || (customServerRoles != null) && (customServerRoles.length != 0)) { %> <% if (defaultServerRoles != null && defaultServerRoles.length != 0) { for (String defaultServerRole : defaultServerRoles) {%> <% } if (customServerRoles != null && customServerRoles.length != 0) { for (String customServerRole : customServerRoles) { %> <%}%>
<%=defaultServerRole%> ')" class="icon-link" style="background-image:url(../roles-mgt/images/delete.gif);"> <%}%>
<%=customServerRole%> ')" class="icon-link" style="background-image:url(../roles-mgt/images/delete.gif);"> <%}%>
<% } %>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy