- Timestamp:
- Feb 8, 2011, 9:45:46 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/net.sf.basedb.reggie/trunk/resources/index.jsp
r1283 r1284 4 4 import="net.sf.basedb.core.Application" 5 5 import="net.sf.basedb.core.User" 6 import="net.sf.basedb.core.Role" 7 import="net.sf.basedb.core.Group" 6 8 import="net.sf.basedb.core.DbControl" 7 9 import="net.sf.basedb.core.SessionControl" 10 import="net.sf.basedb.core.SystemItems" 11 import="net.sf.basedb.core.ItemQuery" 12 import="net.sf.basedb.core.query.Expressions" 13 import="net.sf.basedb.core.query.Hql" 14 import="net.sf.basedb.core.query.Restrictions" 8 15 import="net.sf.basedb.clients.web.Base" 9 16 import="net.sf.basedb.clients.web.util.HTML" 10 17 import="net.sf.basedb.util.Values" 18 import="java.util.List" 11 19 %> 12 20 <%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> … … 21 29 dc = sc.newDbControl(); 22 30 final User user = User.getById(dc, sc.getLoggedInUserId()); 31 boolean isAdmin = false; 32 boolean isPatientCurator = false; 33 try 34 { 35 Role admin = Role.getById(dc, SystemItems.getId(Role.ADMINISTRATOR)); 36 isAdmin = sc.isMemberOf(admin); 37 } 38 catch (RuntimeException ex) 39 {} 40 try 41 { 42 ItemQuery<Group> query = Group.getQuery(); 43 query.restrict(Restrictions.eq(Hql.property("name"), Expressions.string("PatientCurator"))); 44 List<Group> result = query.list(dc); 45 if (result.size() == 1) 46 { 47 isPatientCurator = sc.isMemberOf(result.get(0)); 48 } 49 } 50 catch (RuntimeException ex) 51 {} 23 52 %> 24 53 <base:page type="default" > … … 38 67 <div class="boxedbottom"> 39 68 <ul> 40 <li><a href="persinfo.jsp?ID=<%=ID%>">Personal information registration</a> 69 <% 70 if (isAdmin) 71 { 72 %> 73 <li><a href="install.jsp?ID=<%=ID%>">Verify/install required annotation types and other items</a> 74 <% 75 } 76 if (isPatientCurator || isAdmin) 77 { 78 %> 79 <li><a href="persinfo.jsp?ID=<%=ID%>">Personal information registration</a> 80 <% 81 } 82 %> 41 83 </ul> 42 84
Note: See TracChangeset
for help on using the changeset viewer.