Changeset 4630


Ignore:
Timestamp:
Nov 21, 2017, 11:29:11 AM (6 years ago)
Author:
Nicklas Nordborg
Message:

References #1006: External data filtering and mapping wizard

Re-organized things to get an index page for Relax. The page should only be accessible by administrators.

Added link to the installation wizard and the "Map external data to releases" wizard (no page exists for this one yet).

Location:
extensions/net.sf.basedb.relax/trunk
Files:
4 added
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.relax/trunk/META-INF/extensions.xml

    r4610 r4630  
    6969        <title>Relax (admin)</title>
    7070        <tooltip>Relax administration</tooltip>
    71         <data-url>~/admin/install.jsp?ID=$SESSION-ID$</data-url>
     71        <data-url>~/index-admin.jsp?ID=$SESSION-ID$</data-url>
    7272        <role>net.sf.basedb.core.Role.ADMINISTRATOR</role>
    7373      </parameters>
  • extensions/net.sf.basedb.relax/trunk/resources/admin/install.jsp

    r4362 r4630  
    44  import="net.sf.basedb.core.Application"
    55  import="net.sf.basedb.core.User"
     6  import="net.sf.basedb.core.Role"
    67  import="net.sf.basedb.core.DbControl"
    78  import="net.sf.basedb.core.SessionControl"
     9  import="net.sf.basedb.core.SystemItems"
     10  import="net.sf.basedb.core.PermissionDeniedException"
    811  import="net.sf.basedb.clients.web.Base"
    912  import="net.sf.basedb.clients.web.util.HTML"
     13  import="net.sf.basedb.clients.web.WebException"
    1014  import="net.sf.basedb.clients.web.extensions.ExtensionsControl"
    1115  import="net.sf.basedb.util.Values"
     
    1721final String ID = sc.getId();
    1822final float scale = Base.getScale(sc);
    19 final String home = ExtensionsControl.getHomeUrl("net.sf.basedb.relax");
     23final String home = ExtensionsControl.getHomeUrl("net.sf.basedb.relax.admin");
    2024DbControl dc = null;
    2125try
     
    2327  dc = sc.newDbControl();
    2428  final User user = User.getById(dc, sc.getLoggedInUserId());
     29  boolean isAdmin = user.getId() == SystemItems.getId(User.ROOT)
     30    || sc.getActiveRoles().contains(SystemItems.getId(Role.ADMINISTRATOR));
     31 
     32  if (!isAdmin)
     33  {
     34    throw new PermissionDeniedException("This page requires Administrator privileges.");
     35  }
     36
    2537%>
    2638<base:page type="default" >
     
    120132
    121133  <p:path><p:pathelement
    122     title="Relax" href="<%="../index.jsp?ID="+ID%>"
     134    title="Relax" href="<%="../index-admin.jsp?ID="+ID%>"
    123135    /><p:pathelement title="Installation wizard"
    124136    /></p:path>
Note: See TracChangeset for help on using the changeset viewer.