1 17 package org.alfresco.web.app.portlet; 18 19 import javax.portlet.PortletContext; 20 import javax.portlet.PortletException; 21 import javax.portlet.RenderRequest; 22 import javax.portlet.RenderResponse; 23 24 import org.alfresco.service.cmr.security.PermissionService; 25 import org.alfresco.web.app.servlet.AuthenticationHelper; 26 import org.alfresco.web.bean.repository.User; 27 import org.apache.myfaces.portlet.DefaultViewSelector; 28 29 32 public class AlfrescoDefaultViewSelector implements DefaultViewSelector 33 { 34 37 public String selectViewId(RenderRequest request, RenderResponse response) throws PortletException 38 { 39 User user = (User)request.getPortletSession().getAttribute(AuthenticationHelper.AUTHENTICATION_USER); 40 if (user != null && user.getUserName().equals(PermissionService.GUEST_AUTHORITY)) 41 { 42 return "/jsp/browse/browse.jsp"; 43 } 44 else 45 { 46 return null; 47 } 48 } 49 50 53 public void setPortletContext(PortletContext portletContext) 54 { 55 } 56 } 57 | Popular Tags |