KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > portlet > exomvc > interceptor > RolePermissionVerifier


1 /***************************************************************************
2  * Copyright 2001-2003 The eXo Platform SARL All rights reserved. *
3  * Please look at license.txt in info directory for more license detail. *
4  **************************************************************************/

5 package org.exoplatform.portlet.exomvc.interceptor;
6
7 import javax.portlet.*;
8 import org.exoplatform.portlet.exomvc.config.PageConfig;
9
10 /**
11  * @author Tuan Nguyen (tuan08@users.sourceforge.net)
12  * @since Nov 11, 2004
13  * @version $Id$
14  */

15 public class RolePermissionVerifier implements Interceptor {
16   private String JavaDoc executeRole_ ;
17   private String JavaDoc viewRole_ ;
18   
19   public RolePermissionVerifier(String JavaDoc viewRole, String JavaDoc executeRole) {
20     viewRole_ = viewRole ;
21     executeRole_ = executeRole ;
22   }
23   
24   public void intercept(PageConfig pconfig, ActionRequest req, ActionResponse res) throws Exception JavaDoc {
25     if(executeRole_ == null) return ;
26     if(req.isUserInRole(executeRole_)) {
27       
28     }
29   }
30   
31   public void intercept(PageConfig pconfig, RenderRequest req, RenderResponse res) throws Exception JavaDoc {
32     if(viewRole_ == null) return ;
33     if(!req.isUserInRole(viewRole_)) {
34       
35     }
36   }
37 }
Popular Tags