@Override public boolean isShow(PortletRequest portletRequest) { try { ThemeDisplay themeDisplay = (ThemeDisplay) portletRequest.getAttribute(WebKeys.THEME_DISPLAY); UserGroup userGroup = ActionUtil.getUserGroup(portletRequest); if (UserGroupPermissionUtil.contains( themeDisplay.getPermissionChecker(), userGroup.getUserGroupId(), ActionKeys.UPDATE) && UserGroupPermissionUtil.contains( themeDisplay.getPermissionChecker(), userGroup.getUserGroupId(), ActionKeys.VIEW)) { return true; } return false; } catch (Exception e) { } return false; }
@Override public String getURL(PortletRequest portletRequest, PortletResponse portletResponse) { try { PortletURL portletURL = PortletURLFactoryUtil.create( portletRequest, UserGroupsAdminPortletKeys.USER_GROUPS_ADMIN, PortletRequest.RENDER_PHASE); portletURL.setParameter("mvcPath", "/edit_user_group.jsp"); portletURL.setParameter("redirect", PortalUtil.getCurrentURL(portletRequest)); UserGroup userGroup = ActionUtil.getUserGroup(portletRequest); portletURL.setParameter("userGroupId", String.valueOf(userGroup.getUserGroupId())); return portletURL.toString(); } catch (Exception e) { } return StringPool.BLANK; }