1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17   * SOFTWARE.
18   */
19  
20  package com.liferay.portal.service;
21  
22  import com.liferay.portal.PortalException;
23  import com.liferay.portal.SystemException;
24  import com.liferay.portal.kernel.annotation.Isolation;
25  import com.liferay.portal.kernel.annotation.Propagation;
26  import com.liferay.portal.kernel.annotation.Transactional;
27  
28  /**
29   * <a href="PermissionLocalService.java.html"><b><i>View Source</i></b></a>
30   *
31   * <p>
32   * ServiceBuilder generated this class. Modifications in this class will be
33   * overwritten the next time is generated.
34   * </p>
35   *
36   * <p>
37   * This interface defines the service. The default implementation is
38   * <code>com.liferay.portal.service.impl.PermissionLocalServiceImpl</code>.
39   * Modify methods in that class and rerun ServiceBuilder to populate this class
40   * and all other generated classes.
41   * </p>
42   *
43   * <p>
44   * This is a local service. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM.
45   * </p>
46   *
47   * @author Brian Wing Shun Chan
48   *
49   * @see com.liferay.portal.service.PermissionLocalServiceUtil
50   *
51   */
52  @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
53      PortalException.class, SystemException.class})
54  public interface PermissionLocalService {
55      public com.liferay.portal.model.Permission addPermission(
56          com.liferay.portal.model.Permission permission)
57          throws com.liferay.portal.SystemException;
58  
59      public com.liferay.portal.model.Permission createPermission(
60          long permissionId);
61  
62      public void deletePermission(long permissionId)
63          throws com.liferay.portal.SystemException,
64              com.liferay.portal.PortalException;
65  
66      public void deletePermission(com.liferay.portal.model.Permission permission)
67          throws com.liferay.portal.SystemException;
68  
69      public java.util.List<Object> dynamicQuery(
70          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
71          throws com.liferay.portal.SystemException;
72  
73      public java.util.List<Object> dynamicQuery(
74          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
75          int end) throws com.liferay.portal.SystemException;
76  
77      @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
78      public com.liferay.portal.model.Permission getPermission(long permissionId)
79          throws com.liferay.portal.SystemException,
80              com.liferay.portal.PortalException;
81  
82      @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
83      public java.util.List<com.liferay.portal.model.Permission> getPermissions(
84          int start, int end) throws com.liferay.portal.SystemException;
85  
86      @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
87      public int getPermissionsCount() throws com.liferay.portal.SystemException;
88  
89      public com.liferay.portal.model.Permission updatePermission(
90          com.liferay.portal.model.Permission permission)
91          throws com.liferay.portal.SystemException;
92  
93      public com.liferay.portal.model.Permission updatePermission(
94          com.liferay.portal.model.Permission permission, boolean merge)
95          throws com.liferay.portal.SystemException;
96  
97      public com.liferay.portal.model.Permission addPermission(long companyId,
98          java.lang.String actionId, long resourceId)
99          throws com.liferay.portal.SystemException;
100 
101     public java.util.List<com.liferay.portal.model.Permission> addPermissions(
102         long companyId, java.lang.String name, long resourceId,
103         boolean portletActions) throws com.liferay.portal.SystemException;
104 
105     public java.util.List<com.liferay.portal.model.Permission> addPermissions(
106         long companyId, java.util.List<String> actionIds, long resourceId)
107         throws com.liferay.portal.SystemException;
108 
109     public void addUserPermissions(long userId, java.lang.String[] actionIds,
110         long resourceId)
111         throws com.liferay.portal.PortalException,
112             com.liferay.portal.SystemException;
113 
114     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
115     public java.util.List<String> getActions(
116         java.util.List<com.liferay.portal.model.Permission> permissions);
117 
118     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
119     public java.util.List<com.liferay.portal.model.Permission> getGroupPermissions(
120         long groupId, long resourceId)
121         throws com.liferay.portal.SystemException;
122 
123     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
124     public java.util.List<com.liferay.portal.model.Permission> getGroupPermissions(
125         long groupId, long companyId, java.lang.String name, int scope,
126         java.lang.String primKey) throws com.liferay.portal.SystemException;
127 
128     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
129     public java.util.List<com.liferay.portal.model.Permission> getOrgGroupPermissions(
130         long organizationId, long groupId, long resourceId)
131         throws com.liferay.portal.SystemException;
132 
133     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
134     public long getLatestPermissionId()
135         throws com.liferay.portal.SystemException;
136 
137     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
138     public java.util.List<com.liferay.portal.model.Permission> getPermissions(
139         long companyId, java.lang.String[] actionIds, long resourceId)
140         throws com.liferay.portal.SystemException;
141 
142     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
143     public java.util.List<com.liferay.portal.model.Permission> getRolePermissions(
144         long roleId) throws com.liferay.portal.SystemException;
145 
146     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
147     public java.util.List<com.liferay.portal.model.Permission> getRolePermissions(
148         long roleId, long resourceId) throws com.liferay.portal.SystemException;
149 
150     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
151     public java.util.List<com.liferay.portal.model.Permission> getUserPermissions(
152         long userId, long resourceId) throws com.liferay.portal.SystemException;
153 
154     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
155     public java.util.List<com.liferay.portal.model.Permission> getUserPermissions(
156         long userId, long companyId, java.lang.String name, int scope,
157         java.lang.String primKey) throws com.liferay.portal.SystemException;
158 
159     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
160     public boolean hasGroupPermission(long groupId, java.lang.String actionId,
161         long resourceId) throws com.liferay.portal.SystemException;
162 
163     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
164     public boolean hasRolePermission(long roleId, long companyId,
165         java.lang.String name, int scope, java.lang.String actionId)
166         throws com.liferay.portal.SystemException;
167 
168     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
169     public boolean hasRolePermission(long roleId, long companyId,
170         java.lang.String name, int scope, java.lang.String primKey,
171         java.lang.String actionId) throws com.liferay.portal.SystemException;
172 
173     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
174     public boolean hasUserPermission(long userId, java.lang.String actionId,
175         long resourceId) throws com.liferay.portal.SystemException;
176 
177     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
178     public boolean hasUserPermissions(long userId, long groupId,
179         java.util.List<com.liferay.portal.model.Resource> resources,
180         java.lang.String actionId,
181         com.liferay.portal.security.permission.PermissionCheckerBag permissionCheckerBag)
182         throws com.liferay.portal.PortalException,
183             com.liferay.portal.SystemException;
184 
185     public void setGroupPermissions(long groupId, java.lang.String[] actionIds,
186         long resourceId)
187         throws com.liferay.portal.PortalException,
188             com.liferay.portal.SystemException;
189 
190     public void setGroupPermissions(java.lang.String className,
191         java.lang.String classPK, long groupId, java.lang.String[] actionIds,
192         long resourceId)
193         throws com.liferay.portal.PortalException,
194             com.liferay.portal.SystemException;
195 
196     public void setOrgGroupPermissions(long organizationId, long groupId,
197         java.lang.String[] actionIds, long resourceId)
198         throws com.liferay.portal.PortalException,
199             com.liferay.portal.SystemException;
200 
201     public void setRolePermission(long roleId, long companyId,
202         java.lang.String name, int scope, java.lang.String primKey,
203         java.lang.String actionId)
204         throws com.liferay.portal.PortalException,
205             com.liferay.portal.SystemException;
206 
207     public void setRolePermissions(long roleId, long companyId,
208         java.lang.String name, int scope, java.lang.String primKey,
209         java.lang.String[] actionIds)
210         throws com.liferay.portal.PortalException,
211             com.liferay.portal.SystemException;
212 
213     public void setRolePermissions(long roleId, java.lang.String[] actionIds,
214         long resourceId)
215         throws com.liferay.portal.PortalException,
216             com.liferay.portal.SystemException;
217 
218     public void setUserPermissions(long userId, java.lang.String[] actionIds,
219         long resourceId)
220         throws com.liferay.portal.PortalException,
221             com.liferay.portal.SystemException;
222 
223     public void unsetRolePermission(long roleId, long permissionId)
224         throws com.liferay.portal.SystemException;
225 
226     public void unsetRolePermission(long roleId, long companyId,
227         java.lang.String name, int scope, java.lang.String primKey,
228         java.lang.String actionId) throws com.liferay.portal.SystemException;
229 
230     public void unsetRolePermissions(long roleId, long companyId,
231         java.lang.String name, int scope, java.lang.String actionId)
232         throws com.liferay.portal.SystemException;
233 
234     public void unsetUserPermissions(long userId, java.lang.String[] actionIds,
235         long resourceId) throws com.liferay.portal.SystemException;
236 }