blob: 8c6836408368e8eaf7ca72ef232cb88cca38ea77 [file] [log] [blame]
<%
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var privilegesInfo = new Packages.org.apache.sling.jcr.jackrabbit.accessmanager.PrivilegesInfo();
var rb = request.getResourceBundle("org.apache.sling.accessmanager.Resources", null);
var canModify = privilegesInfo.canModifyAccessControl(currentNode);
%>
<ul id="sidebar-nav" class="ui-corner-br">
<li>
<a href="<%=request.contextPath%><%=resource.path%>.acl.html"><%=rb.getString(canModify ? "menu.link.update.acl" : "menu.link.view.acl")%></a>
</li>
<% if (canModify) { %>
<li>
<a style="margin-left: 15px;" href="<%=request.contextPath%><%=resource.path%>.ace.html"><%=rb.getString("menu.link.add.ace")%></a>
</li>
<% } %>
<%
var reqUri = request.getAttribute("javax.servlet.include.request_uri");
var isAcePage = reqUri.endsWith(".ace.html");
if (isAcePage) {
if (canModify) {
var pid = request.getParameter("pid");
if (pid != null && pid.length() > 0) {
%>
<li class="ui-corner-all ui-state-highlight">
<a style="margin-left: 15px;" href="<%=request.contextPath%><%=resource.path%>.ace.html?pid=<%=pid%>"><%=rb.getString("menu.link.update.ace")%></a>
</li>
<% }
} else { %>
<li class="ui-corner-all ui-state-highlight">
<a style="margin-left: 15px;" href="<%=request.contextPath%><%=resource.path%>.ace.html?pid=<%=pid%>"><%=rb.getString("menu.link.view.ace")%></a>
</li>
<% }
} /*endif(isAcePage) */%>
</ul>