001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.security.auth;
016    
017    import com.liferay.portal.kernel.security.pacl.permission.PortalRuntimePermission;
018    
019    import java.util.Set;
020    
021    /**
022     * @author Tomas Polesovsky
023     * @author Raymond Aug??
024     */
025    public class InterruptedPortletRequestWhitelistUtil {
026    
027            public static PortletRequestWhitelist
028                    getInterruptedPortletRequestWhitelist() {
029    
030                    PortalRuntimePermission.checkGetBeanProperty(
031                            PortletRequestWhitelist.class);
032    
033                    return _interruptedPortletRequestWhitelist;
034            }
035    
036            public static Set<String> getPortletInvocationWhitelist() {
037                    return getInterruptedPortletRequestWhitelist().
038                            getPortletInvocationWhitelist();
039            }
040    
041            public static Set<String> getPortletInvocationWhitelistActions() {
042                    return getInterruptedPortletRequestWhitelist().
043                            getPortletInvocationWhitelistActions();
044            }
045    
046            public static boolean isPortletInvocationWhitelisted(
047                    long companyId, String portletId, String strutsAction) {
048    
049                    return getInterruptedPortletRequestWhitelist().
050                            isPortletInvocationWhitelisted(companyId, portletId, strutsAction);
051            }
052    
053            public static Set<String> resetPortletInvocationWhitelist() {
054                    return getInterruptedPortletRequestWhitelist().
055                            resetPortletInvocationWhitelist();
056            }
057    
058            public static Set<String> resetPortletInvocationWhitelistActions() {
059                    return getInterruptedPortletRequestWhitelist().
060                            resetPortletInvocationWhitelistActions();
061            }
062    
063            public void setInterruptedPortletRequestWhitelist(
064                    PortletRequestWhitelist whitelist) {
065    
066                    PortalRuntimePermission.checkSetBeanProperty(getClass());
067    
068                    _interruptedPortletRequestWhitelist = whitelist;
069            }
070    
071            private static PortletRequestWhitelist _interruptedPortletRequestWhitelist;
072    
073    }