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.service.permission;
016    
017    import com.liferay.portal.kernel.exception.PortalException;
018    import com.liferay.portal.kernel.exception.SystemException;
019    import com.liferay.portal.model.Layout;
020    import com.liferay.portal.model.Portlet;
021    import com.liferay.portal.security.permission.PermissionChecker;
022    
023    import java.util.Collection;
024    
025    import javax.portlet.PortletMode;
026    
027    /**
028     * @author Brian Wing Shun Chan
029     * @author Raymond Aug??
030     */
031    public interface PortletPermission {
032    
033            public void check(
034                            PermissionChecker permissionChecker, Layout layout,
035                            String portletId, String actionId)
036                    throws PortalException, SystemException;
037    
038            public void check(
039                            PermissionChecker permissionChecker, Layout layout,
040                            String portletId, String actionId, boolean strict)
041                    throws PortalException, SystemException;
042    
043            public void check(
044                            PermissionChecker permissionChecker, long groupId, Layout layout,
045                            String portletId, String actionId)
046                    throws PortalException, SystemException;
047    
048            public void check(
049                            PermissionChecker permissionChecker, long groupId, Layout layout,
050                            String portletId, String actionId, boolean strict)
051                    throws PortalException, SystemException;
052    
053            public void check(
054                            PermissionChecker permissionChecker, long groupId, long plid,
055                            String portletId, String actionId)
056                    throws PortalException, SystemException;
057    
058            public void check(
059                            PermissionChecker permissionChecker, long groupId, long plid,
060                            String portletId, String actionId, boolean strict)
061                    throws PortalException, SystemException;
062    
063            public void check(
064                            PermissionChecker permissionChecker, long plid, String portletId,
065                            String actionId)
066                    throws PortalException, SystemException;
067    
068            public void check(
069                            PermissionChecker permissionChecker, long plid, String portletId,
070                            String actionId, boolean strict)
071                    throws PortalException, SystemException;
072    
073            public void check(
074                            PermissionChecker permissionChecker, String portletId,
075                            String actionId)
076                    throws PortalException, SystemException;
077    
078            public boolean contains(
079                            PermissionChecker permissionChecker, Layout layout, Portlet portlet,
080                            String actionId)
081                    throws PortalException, SystemException;
082    
083            public boolean contains(
084                            PermissionChecker permissionChecker, Layout layout, Portlet portlet,
085                            String actionId, boolean strict)
086                    throws PortalException, SystemException;
087    
088            public boolean contains(
089                            PermissionChecker permissionChecker, Layout layout,
090                            String portletId, String actionId)
091                    throws PortalException, SystemException;
092    
093            public boolean contains(
094                            PermissionChecker permissionChecker, Layout layout,
095                            String portletId, String actionId, boolean strict)
096                    throws PortalException, SystemException;
097    
098            public boolean contains(
099                            PermissionChecker permissionChecker, long groupId, Layout layout,
100                            Portlet portlet, String actionId)
101                    throws PortalException, SystemException;
102    
103            public boolean contains(
104                            PermissionChecker permissionChecker, long groupId, Layout layout,
105                            Portlet portlet, String actionId, boolean strict)
106                    throws PortalException, SystemException;
107    
108            public boolean contains(
109                            PermissionChecker permissionChecker, long groupId, Layout layout,
110                            String portletId, String actionId)
111                    throws PortalException, SystemException;
112    
113            public boolean contains(
114                            PermissionChecker permissionChecker, long groupId, Layout layout,
115                            String portletId, String actionId, boolean strict)
116                    throws PortalException, SystemException;
117    
118            public boolean contains(
119                            PermissionChecker permissionChecker, long groupId, long plid,
120                            Portlet portlet, String actionId, boolean strict)
121                    throws PortalException, SystemException;
122    
123            public boolean contains(
124                            PermissionChecker permissionChecker, long groupId, long plid,
125                            String portletId, String actionId, boolean strict)
126                    throws PortalException, SystemException;
127    
128            public boolean contains(
129                            PermissionChecker permissionChecker, long plid, Portlet portlet,
130                            String actionId)
131                    throws PortalException, SystemException;
132    
133            public boolean contains(
134                            PermissionChecker permissionChecker, long plid, Portlet portlet,
135                            String actionId, boolean strict)
136                    throws PortalException, SystemException;
137    
138            public boolean contains(
139                            PermissionChecker permissionChecker, long plid, String portletId,
140                            String actionId)
141                    throws PortalException, SystemException;
142    
143            public boolean contains(
144                            PermissionChecker permissionChecker, long plid, String portletId,
145                            String actionId, boolean strict)
146                    throws PortalException, SystemException;
147    
148            public boolean contains(
149                            PermissionChecker permissionChecker, String portletId,
150                            String actionId)
151                    throws PortalException, SystemException;
152    
153            public String getPrimaryKey(long plid, String portletId);
154    
155            public boolean hasAccessPermission(
156                            PermissionChecker permissionChecker, long scopeGroupId,
157                            Layout layout, Portlet portlet, PortletMode portletMode)
158                    throws PortalException, SystemException;
159    
160            public boolean hasConfigurationPermission(
161                            PermissionChecker permissionChecker, long groupId, Layout layout,
162                            String actionId)
163                    throws PortalException, SystemException;
164    
165            public boolean hasControlPanelAccessPermission(
166                            PermissionChecker permissionChecker, long scopeGroupId,
167                            Collection<Portlet> portlets)
168                    throws PortalException, SystemException;
169    
170            public boolean hasControlPanelAccessPermission(
171                            PermissionChecker permissionChecker, long scopeGroupId,
172                            Portlet portlet)
173                    throws PortalException, SystemException;
174    
175            public boolean hasControlPanelAccessPermission(
176                            PermissionChecker permissionChecker, long scopeGroupId,
177                            String portletId)
178                    throws PortalException, SystemException;
179    
180            public boolean hasLayoutManagerPermission(
181                    String portletId, String actionId);
182    
183    }