001    /**
002     * Copyright (c) 2000-present 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.kernel.security.permission;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.exception.NoSuchResourceActionException;
020    import com.liferay.portal.kernel.model.Group;
021    import com.liferay.portal.kernel.model.Portlet;
022    import com.liferay.portal.kernel.model.Role;
023    
024    import java.io.InputStream;
025    
026    import java.util.List;
027    import java.util.Locale;
028    
029    import javax.servlet.http.HttpServletRequest;
030    
031    /**
032     * @author Brian Wing Shun Chan
033     * @author Daeyoung Song
034     */
035    @ProviderType
036    public interface ResourceActions {
037    
038            public void checkAction(String name, String actionId)
039                    throws NoSuchResourceActionException;
040    
041            public String getAction(HttpServletRequest request, String action);
042    
043            public String getAction(Locale locale, String action);
044    
045            public String getActionNamePrefix();
046    
047            /**
048             * @deprecated As of 7.0.0
049             */
050            @Deprecated
051            public List<String> getActionsNames(
052                    HttpServletRequest request, List<String> actions);
053    
054            /**
055             * @deprecated As of 7.0.0
056             */
057            @Deprecated
058            public List<String> getActionsNames(
059                    HttpServletRequest request, String name, long actionIds);
060    
061            public String getCompositeModelNameSeparator();
062    
063            public List<String> getModelNames();
064    
065            public List<String> getModelPortletResources(String name);
066    
067            public String getModelResource(HttpServletRequest request, String name);
068    
069            public String getModelResource(Locale locale, String name);
070    
071            public List<String> getModelResourceActions(String name);
072    
073            public List<String> getModelResourceGroupDefaultActions(String name);
074    
075            public List<String> getModelResourceGuestDefaultActions(String name);
076    
077            public List<String> getModelResourceGuestUnsupportedActions(String name);
078    
079            public String getModelResourceNamePrefix();
080    
081            public List<String> getModelResourceOwnerDefaultActions(String name);
082    
083            public Double getModelResourceWeight(String name);
084    
085            public String[] getOrganizationModelResources();
086    
087            public String[] getPortalModelResources();
088    
089            public String getPortletBaseResource(String portletName);
090    
091            public List<String> getPortletModelResources(String portletName);
092    
093            public List<String> getPortletNames();
094    
095            public List<String> getPortletResourceActions(Portlet portlet);
096    
097            public List<String> getPortletResourceActions(String name);
098    
099            public List<String> getPortletResourceGroupDefaultActions(String name);
100    
101            public List<String> getPortletResourceGuestDefaultActions(String name);
102    
103            public List<String> getPortletResourceGuestUnsupportedActions(String name);
104    
105            public List<String> getPortletResourceLayoutManagerActions(String name);
106    
107            public String getPortletRootModelResource(String portletName);
108    
109            public List<String> getResourceActions(String name);
110    
111            public List<String> getResourceActions(
112                    String portletResource, String modelResource);
113    
114            public List<String> getResourceGroupDefaultActions(String name);
115    
116            public List<String> getResourceGuestUnsupportedActions(
117                    String portletResource, String modelResource);
118    
119            public List<Role> getRoles(
120                    long companyId, Group group, String modelResource, int[] roleTypes);
121    
122            public String[] getRootModelResources();
123    
124            public boolean hasModelResourceActions(String name);
125    
126            public boolean isOrganizationModelResource(String modelResource);
127    
128            public boolean isPortalModelResource(String modelResource);
129    
130            public boolean isRootModelResource(String modelResource);
131    
132            public void read(
133                            String servletContextName, ClassLoader classLoader, String source)
134                    throws Exception;
135    
136            /**
137             * @deprecated As of 7.0.0
138             */
139            @Deprecated
140            public void read(String servletContextName, InputStream inputStream)
141                    throws Exception;
142    
143    }