<%-- The contents of this file are subject to the license and copyright detailed in the LICENSE and NOTICE files at the root of the source tree and available online at http://www.dspace.org/license/ --%> <%-- - Show policies for a community, allowing you to modify, delete - or add to them - - Attributes: - community - Community being modified - policies - ResourcePolicy [] of policies for the community - Returns: - submit value community_addpolicy to add a policy - submit value community_editpolicy to edit policy - submit value community_deletepolicy to delete policy - - policy_id - ID of policy to edit, delete - --%> <%@ page contentType="text/html;charset=UTF-8" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> <%@ taglib uri="http://www.dspace.org/dspace-tags.tld" prefix="dspace" %> <%@ page import="java.util.List" %> <%@ page import="java.util.Iterator" %> <%@ page import="javax.servlet.jsp.jstl.fmt.LocaleSupport" %> <%@ page import="org.dspace.authorize.ResourcePolicy" %> <%@ page import="org.dspace.content.Community" %> <%@ page import="org.dspace.core.Constants" %> <%@ page import="org.dspace.eperson.EPerson" %> <%@ page import="org.dspace.eperson.Group" %> <%@ page import="org.dspace.authorize.factory.AuthorizeServiceFactory" %> <%@ page import="org.dspace.authorize.service.ResourcePolicyService" %> <% Community community = (Community) request.getAttribute("community"); List policies = (List) request.getAttribute("policies"); // Is the logged in user an admin or community admin or collection admin Boolean admin = (Boolean)request.getAttribute("is.admin"); boolean isAdmin = (admin == null ? false : admin.booleanValue()); Boolean communityAdmin = (Boolean)request.getAttribute("is.communityAdmin"); boolean isCommunityAdmin = (communityAdmin == null ? false : communityAdmin.booleanValue()); Boolean collectionAdmin = (Boolean)request.getAttribute("is.collectionAdmin"); boolean isCollectionAdmin = (collectionAdmin == null ? false : collectionAdmin.booleanValue()); String naviAdmin = "admin"; String link = "/dspace-admin"; if(!isAdmin && (isCommunityAdmin || isCollectionAdmin)) { naviAdmin = "community-or-collection-admin"; link = "/tools"; } %>

<%= community.getName() %> hdl:<%= community.getHandle() %> <%=community.getID()%> ">

" />

<% ResourcePolicyService resourcePolicyService = AuthorizeServiceFactory.getInstance().getResourcePolicyService(); String row = "even"; for (ResourcePolicy rp : policies) { %> <% row = (row.equals("odd") ? "even" : "odd"); } %>
   
<%= rp.getID() %> <%= resourcePolicyService.getActionText(rp) %> <%= (rp.getGroup() == null ? "..." : rp.getGroup().getName() ) %>
" />
" />