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