1 5 package org.exoplatform.portlet.exomvc.interceptor; 6 7 import javax.portlet.*; 8 import org.exoplatform.portlet.exomvc.config.PageConfig; 9 10 15 public class RolePermissionVerifier implements Interceptor { 16 private String executeRole_ ; 17 private String viewRole_ ; 18 19 public RolePermissionVerifier(String viewRole, String executeRole) { 20 viewRole_ = viewRole ; 21 executeRole_ = executeRole ; 22 } 23 24 public void intercept(PageConfig pconfig, ActionRequest req, ActionResponse res) throws Exception { 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 { 32 if(viewRole_ == null) return ; 33 if(!req.isUserInRole(viewRole_)) { 34 35 } 36 } 37 } | Popular Tags |