<%-- /** * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved. * * This library is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free * Software Foundation; either version 2.1 of the License, or (at your option) * any later version. * * This library is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. */ --%> <%@page import="java.util.ArrayList"%> <%@ include file="/html/taglib/init.jsp"%> <% String[] classNames = (String[]) request .getAttribute("liferay-ui:my_sites:classNames"); String cssClass = GetterUtil.getString((String) request .getAttribute("liferay-ui:my_sites:cssClass")); boolean includeControlPanel = GetterUtil .getBoolean((String) request .getAttribute("liferay-ui:my_sites:includeControlPanel")); int max = GetterUtil.getInteger((String) request .getAttribute("liferay-ui:my_sites:max")); if (max <= 0) { max = PropsValues.MY_SITES_MAX_ELEMENTS; } List mySiteGroups = new ArrayList(); boolean isAdmin = false, isSiteAdmin = false; for (Role role : user.getRoles()) { if ("Administrator".equals(role.getName())) { isAdmin = true; mySiteGroups = user.getMySiteGroups(classNames, includeControlPanel, max); break; } } if (! isAdmin) { try { for (Group group : user.getMySiteGroups(classNames, includeControlPanel, max)) { if (group.getChildren(true).isEmpty() && (group.getFriendlyURL().compareTo("/data-e-infrastructure-gateway") != 0) ) { mySiteGroups.add(group); } } } catch (SystemException e1) { e1.printStackTrace(); } } %>