<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">

<!--
 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.
-->

<web-app>
  <servlet>
    <!-- Use security-role-ref tags to map ldap groups to tomcat roles.
         role-link specifies the tomcat role, role-name the ldap group name.
         The tomcat role name must also appear inside an auth-contraint tag
         below. 
    -->
    <!--
    <security-role-ref>
      <role-name>packageadmin</role-name>
      <role-link>Admin</role-link>
    </security-role-ref>
    -->
    <servlet-name>velocity</servlet-name>
    <servlet-class>org.apache.velocity.tools.view.VelocityLayoutServlet</servlet-class>
    <init-param>
      <param-name>org.apache.velocity.tools.deprecationSupportMode</param-name>
      <param-value>false</param-value>
    </init-param>
    <init-param>
      <param-name>org.apache.velocity.tools.cleanConfiguration</param-name>
      <param-value>true</param-value>
    </init-param>
    <init-param>
      <param-name>org.apache.velocity.tools.userCanOverwriteTools</param-name>
      <param-value>false</param-value>
    </init-param>
  </servlet>
  <servlet-mapping>
    <servlet-name>velocity</servlet-name>
    <url-pattern>*.vm</url-pattern>
  </servlet-mapping>
  <welcome-file-list>
    <welcome-file>index.vm</welcome-file>
  </welcome-file-list>
  <security-constraint>
    <display-name>Public</display-name>
    <web-resource-collection>
        <web-resource-name>public</web-resource-name>
        <url-pattern>/css/*</url-pattern>            
        <url-pattern>/js/*</url-pattern>            
        <url-pattern>/images/*</url-pattern>            
    </web-resource-collection>
  </security-constraint>
  <security-constraint>
    <display-name>Authorized access only</display-name>
    <web-resource-collection>
        <web-resource-name>PackageManager</web-resource-name>
        <url-pattern>/</url-pattern>            
    </web-resource-collection>
    <auth-constraint>
      <role-name>packagemanager</role-name>
      <role-name>packageadmin</role-name>
    </auth-constraint>
  </security-constraint>
  <security-constraint>
    <display-name>Deny access to template include files</display-name>
    <web-resource-collection>
        <web-resource-name>exclude</web-resource-name>
        <url-pattern>*.inc</url-pattern>            
    </web-resource-collection>
    <auth-constraint/>
  </security-constraint>
  <login-config>
    <auth-method>BASIC</auth-method>
    <realm-name>Anmeldung PackageManager</realm-name>
  </login-config>
  <security-role><role-name>packagemanager</role-name></security-role>
  <security-role><role-name>packageadmin</role-name></security-role>
  <security-role><role-name>packageapprover</role-name></security-role>
</web-app>
