1 5 package org.exoplatform.faces.core.event; 6 7 import javax.faces.context.ExternalContext; 8 import javax.faces.context.FacesContext; 9 import org.exoplatform.commons.exception.ExoMessageException; 10 import org.exoplatform.container.SessionContainer; 11 import org.exoplatform.portal.session.RequestInfo; 12 18 public class CheckOwnerInterceptor extends ActionInterceptor { 19 20 public void preExecute(ExoActionEvent event) throws Exception { 21 ExternalContext econtext = FacesContext.getCurrentInstance().getExternalContext() ; 22 RequestInfo rinfo = (RequestInfo)SessionContainer.getComponent(RequestInfo.class) ; 23 if(rinfo.getPortalOwner().equals(econtext.getRemoteUser())) { 24 return ; 25 } 26 Object [] args = {event.getAction()} ; 27 throw new ExoMessageException("CheckOwnerInterceptor.msg.owner-require", args) ; 28 } 29 30 final public void postExecute(ExoActionEvent event) throws Exception { 31 32 } 33 } | Popular Tags |