source: trunk/www/exception/permission_denied.jsp @ 5956

Last change on this file since 5956 was 5956, checked in by Nicklas Nordborg, 10 years ago

References #1655: GUI improvements

  • External program executor configuration dialog.
  • Exception dialogs.
  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.8 KB
Line 
1<%-- $Id: permission_denied.jsp 5956 2012-02-13 15:27:40Z nicklas $
2  ------------------------------------------------------------------
3  Copyright (C) 2005 Nicklas Nordborg
4  Copyright (C) 2006 Jari Häkkinen, Nicklas Nordborg
5  Copyright (C) 2007 Nicklas Nordborg
6
7  This file is part of BASE - BioArray Software Environment.
8  Available at http://base.thep.lu.se/
9
10  BASE is free software; you can redistribute it and/or
11  modify it under the terms of the GNU General Public License
12  as published by the Free Software Foundation; either version 3
13  of the License, or (at your option) any later version.
14
15  BASE is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  GNU General Public License for more details.
19
20  You should have received a copy of the GNU General Public License
21  along with BASE. If not, see <http://www.gnu.org/licenses/>.
22  ------------------------------------------------------------------
23
24  This page is used to catch PermissionDeniedExceptions which are
25  directed here via the exception.jsp page. PermissionDeniedExceptions
26  happen when a user tries to access a protected page without the proper
27  permission. Typically the exception is thrown from the method that
28  retrieves the BaseControl object:
29
30  BASE.getExistingBaseControl(pageContext, permission, item_type);
31
32  The exception is also thrown if trying to manipulate an item without
33  the proper permission, but normally such conditions should not happen
34  if the interface behaves corretly (ie. no "Edit item" link is displayed
35  unless the user has the permission).
36
37  @author Nicklas
38  @version 2.0
39--%>
40<%@ page pageEncoding="UTF-8" session="false"
41  isErrorPage="true"
42%>
43<%@ taglib prefix="base" uri="/WEB-INF/base.tld"
44%>
45<%
46Throwable t = exception;
47//t is either a JasperException, a ServletException or a WebException; see exception.jsp
48if (t instanceof org.apache.jasper.JasperException)
49{
50  t = ((org.apache.jasper.JasperException)t).getRootCause();
51}
52if (t instanceof ServletException)
53{
54  t = ((ServletException)t).getRootCause();
55  // t should now be an PermissionDeniedException
56}
57Throwable ex = t;
58String exceptionClassName = ex.getClass().getName().replaceAll("net.sf.basedb.core.", "");
59
60%>
61<base:page type="default" menu="exception" title="Permission denied">
62<base:head scripts="exception.js" styles="popup.css"/>
63<base:body onload="Exception.fixWindow(false)">
64  <h1><%=exceptionClassName + " on page "+request.getAttribute("javax.servlet.error.request_uri")%></h1>
65
66  <div class="content filled bottomborder">
67    <div class="messagecontainer error">
68      <%=ex.getMessage()%>
69    </div>
70  </div> 
71
72  <base:buttongroup subclass="dialogbuttons">
73    <base:button onclick="history.go(-1);" title="Back" />
74    <base:button onclick="window.top.close();" title="Close" />
75  </base:buttongroup>
76
77</base:body>
78</base:page>
79
Note: See TracBrowser for help on using the repository browser.