001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.service;
016    
017    import com.liferay.portal.kernel.annotation.Isolation;
018    import com.liferay.portal.kernel.annotation.Propagation;
019    import com.liferay.portal.kernel.annotation.Transactional;
020    import com.liferay.portal.kernel.exception.PortalException;
021    import com.liferay.portal.kernel.exception.SystemException;
022    
023    /**
024     * The interface for the permission local service.
025     *
026     * <p>
027     * Never modify or reference this interface directly. Always use {@link PermissionLocalServiceUtil} to access the permission local service. Add custom service methods to {@link com.liferay.portal.service.impl.PermissionLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
028     * </p>
029     *
030     * <p>
031     * 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.
032     * </p>
033     *
034     * @author Brian Wing Shun Chan
035     * @see PermissionLocalServiceUtil
036     * @see com.liferay.portal.service.base.PermissionLocalServiceBaseImpl
037     * @see com.liferay.portal.service.impl.PermissionLocalServiceImpl
038     * @generated
039     */
040    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
041            PortalException.class, SystemException.class})
042    public interface PermissionLocalService {
043            /**
044            * Adds the permission to the database. Also notifies the appropriate model listeners.
045            *
046            * @param permission the permission to add
047            * @return the permission that was added
048            * @throws SystemException if a system exception occurred
049            */
050            public com.liferay.portal.model.Permission addPermission(
051                    com.liferay.portal.model.Permission permission)
052                    throws com.liferay.portal.kernel.exception.SystemException;
053    
054            /**
055            * Creates a new permission with the primary key. Does not add the permission to the database.
056            *
057            * @param permissionId the primary key for the new permission
058            * @return the new permission
059            */
060            public com.liferay.portal.model.Permission createPermission(
061                    long permissionId);
062    
063            /**
064            * Deletes the permission with the primary key from the database. Also notifies the appropriate model listeners.
065            *
066            * @param permissionId the primary key of the permission to delete
067            * @throws PortalException if a permission with the primary key could not be found
068            * @throws SystemException if a system exception occurred
069            */
070            public void deletePermission(long permissionId)
071                    throws com.liferay.portal.kernel.exception.PortalException,
072                            com.liferay.portal.kernel.exception.SystemException;
073    
074            /**
075            * Deletes the permission from the database. Also notifies the appropriate model listeners.
076            *
077            * @param permission the permission to delete
078            * @throws SystemException if a system exception occurred
079            */
080            public void deletePermission(com.liferay.portal.model.Permission permission)
081                    throws com.liferay.portal.kernel.exception.SystemException;
082    
083            /**
084            * Performs a dynamic query on the database and returns the matching rows.
085            *
086            * @param dynamicQuery the dynamic query to search with
087            * @return the matching rows
088            * @throws SystemException if a system exception occurred
089            */
090            @SuppressWarnings("rawtypes")
091            public java.util.List dynamicQuery(
092                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
093                    throws com.liferay.portal.kernel.exception.SystemException;
094    
095            /**
096            * Performs a dynamic query on the database and returns a range of the matching rows.
097            *
098            * <p>
099            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
100            * </p>
101            *
102            * @param dynamicQuery the dynamic query to search with
103            * @param start the lower bound of the range of model instances to return
104            * @param end the upper bound of the range of model instances to return (not inclusive)
105            * @return the range of matching rows
106            * @throws SystemException if a system exception occurred
107            */
108            @SuppressWarnings("rawtypes")
109            public java.util.List dynamicQuery(
110                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
111                    int end) throws com.liferay.portal.kernel.exception.SystemException;
112    
113            /**
114            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
115            *
116            * <p>
117            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
118            * </p>
119            *
120            * @param dynamicQuery the dynamic query to search with
121            * @param start the lower bound of the range of model instances to return
122            * @param end the upper bound of the range of model instances to return (not inclusive)
123            * @param orderByComparator the comparator to order the results by
124            * @return the ordered range of matching rows
125            * @throws SystemException if a system exception occurred
126            */
127            @SuppressWarnings("rawtypes")
128            public java.util.List dynamicQuery(
129                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
130                    int end,
131                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
132                    throws com.liferay.portal.kernel.exception.SystemException;
133    
134            /**
135            * Counts the number of rows that match the dynamic query.
136            *
137            * @param dynamicQuery the dynamic query to search with
138            * @return the number of rows that match the dynamic query
139            * @throws SystemException if a system exception occurred
140            */
141            public long dynamicQueryCount(
142                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
143                    throws com.liferay.portal.kernel.exception.SystemException;
144    
145            /**
146            * Gets the permission with the primary key.
147            *
148            * @param permissionId the primary key of the permission to get
149            * @return the permission
150            * @throws PortalException if a permission with the primary key could not be found
151            * @throws SystemException if a system exception occurred
152            */
153            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
154            public com.liferay.portal.model.Permission getPermission(long permissionId)
155                    throws com.liferay.portal.kernel.exception.PortalException,
156                            com.liferay.portal.kernel.exception.SystemException;
157    
158            /**
159            * Gets a range of all the permissions.
160            *
161            * <p>
162            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
163            * </p>
164            *
165            * @param start the lower bound of the range of permissions to return
166            * @param end the upper bound of the range of permissions to return (not inclusive)
167            * @return the range of permissions
168            * @throws SystemException if a system exception occurred
169            */
170            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
171            public java.util.List<com.liferay.portal.model.Permission> getPermissions(
172                    int start, int end)
173                    throws com.liferay.portal.kernel.exception.SystemException;
174    
175            /**
176            * Gets the number of permissions.
177            *
178            * @return the number of permissions
179            * @throws SystemException if a system exception occurred
180            */
181            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
182            public int getPermissionsCount()
183                    throws com.liferay.portal.kernel.exception.SystemException;
184    
185            /**
186            * Updates the permission in the database. Also notifies the appropriate model listeners.
187            *
188            * @param permission the permission to update
189            * @return the permission that was updated
190            * @throws SystemException if a system exception occurred
191            */
192            public com.liferay.portal.model.Permission updatePermission(
193                    com.liferay.portal.model.Permission permission)
194                    throws com.liferay.portal.kernel.exception.SystemException;
195    
196            /**
197            * Updates the permission in the database. Also notifies the appropriate model listeners.
198            *
199            * @param permission the permission to update
200            * @param merge whether to merge the permission with the current session. See {@link com.liferay.portal.service.persistence.BatchSession#update(com.liferay.portal.kernel.dao.orm.Session, com.liferay.portal.model.BaseModel, boolean)} for an explanation.
201            * @return the permission that was updated
202            * @throws SystemException if a system exception occurred
203            */
204            public com.liferay.portal.model.Permission updatePermission(
205                    com.liferay.portal.model.Permission permission, boolean merge)
206                    throws com.liferay.portal.kernel.exception.SystemException;
207    
208            public com.liferay.portal.model.Permission addPermission(long companyId,
209                    java.lang.String actionId, long resourceId)
210                    throws com.liferay.portal.kernel.exception.SystemException;
211    
212            public java.util.List<com.liferay.portal.model.Permission> addPermissions(
213                    long companyId, java.lang.String name, long resourceId,
214                    boolean portletActions)
215                    throws com.liferay.portal.kernel.exception.SystemException;
216    
217            public java.util.List<com.liferay.portal.model.Permission> addPermissions(
218                    long companyId, java.util.List<java.lang.String> actionIds,
219                    long resourceId)
220                    throws com.liferay.portal.kernel.exception.SystemException;
221    
222            public void addUserPermissions(long userId, java.lang.String[] actionIds,
223                    long resourceId)
224                    throws com.liferay.portal.kernel.exception.PortalException,
225                            com.liferay.portal.kernel.exception.SystemException;
226    
227            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
228            public java.util.List<java.lang.String> getActions(
229                    java.util.List<com.liferay.portal.model.Permission> permissions);
230    
231            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
232            public java.util.List<com.liferay.portal.model.Permission> getGroupPermissions(
233                    long groupId, long resourceId)
234                    throws com.liferay.portal.kernel.exception.SystemException;
235    
236            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
237            public java.util.List<com.liferay.portal.model.Permission> getGroupPermissions(
238                    long groupId, long companyId, java.lang.String name, int scope,
239                    java.lang.String primKey)
240                    throws com.liferay.portal.kernel.exception.SystemException;
241    
242            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
243            public java.util.List<com.liferay.portal.model.Permission> getOrgGroupPermissions(
244                    long organizationId, long groupId, long resourceId)
245                    throws com.liferay.portal.kernel.exception.SystemException;
246    
247            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
248            public long getLatestPermissionId()
249                    throws com.liferay.portal.kernel.exception.SystemException;
250    
251            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
252            public java.util.List<com.liferay.portal.model.Permission> getPermissions(
253                    long companyId, java.lang.String[] actionIds, long resourceId)
254                    throws com.liferay.portal.kernel.exception.SystemException;
255    
256            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
257            public java.util.List<com.liferay.portal.model.Permission> getRolePermissions(
258                    long roleId) throws com.liferay.portal.kernel.exception.SystemException;
259    
260            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
261            public java.util.List<com.liferay.portal.model.Permission> getRolePermissions(
262                    long roleId, long resourceId)
263                    throws com.liferay.portal.kernel.exception.SystemException;
264    
265            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
266            public java.util.List<com.liferay.portal.model.Permission> getUserPermissions(
267                    long userId, long resourceId)
268                    throws com.liferay.portal.kernel.exception.SystemException;
269    
270            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
271            public java.util.List<com.liferay.portal.model.Permission> getUserPermissions(
272                    long userId, long companyId, java.lang.String name, int scope,
273                    java.lang.String primKey)
274                    throws com.liferay.portal.kernel.exception.SystemException;
275    
276            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
277            public boolean hasGroupPermission(long groupId, java.lang.String actionId,
278                    long resourceId)
279                    throws com.liferay.portal.kernel.exception.SystemException;
280    
281            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
282            public boolean hasRolePermission(long roleId, long companyId,
283                    java.lang.String name, int scope, java.lang.String actionId)
284                    throws com.liferay.portal.kernel.exception.SystemException;
285    
286            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
287            public boolean hasRolePermission(long roleId, long companyId,
288                    java.lang.String name, int scope, java.lang.String primKey,
289                    java.lang.String actionId)
290                    throws com.liferay.portal.kernel.exception.SystemException;
291    
292            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
293            public boolean hasUserPermission(long userId, java.lang.String actionId,
294                    long resourceId)
295                    throws com.liferay.portal.kernel.exception.SystemException;
296    
297            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
298            public boolean hasUserPermissions(long userId, long groupId,
299                    java.util.List<com.liferay.portal.model.Resource> resources,
300                    java.lang.String actionId,
301                    com.liferay.portal.security.permission.PermissionCheckerBag permissionCheckerBag)
302                    throws com.liferay.portal.kernel.exception.PortalException,
303                            com.liferay.portal.kernel.exception.SystemException;
304    
305            public void setGroupPermissions(long groupId, java.lang.String[] actionIds,
306                    long resourceId)
307                    throws com.liferay.portal.kernel.exception.PortalException,
308                            com.liferay.portal.kernel.exception.SystemException;
309    
310            public void setGroupPermissions(java.lang.String className,
311                    java.lang.String classPK, long groupId, java.lang.String[] actionIds,
312                    long resourceId)
313                    throws com.liferay.portal.kernel.exception.PortalException,
314                            com.liferay.portal.kernel.exception.SystemException;
315    
316            public void setOrgGroupPermissions(long organizationId, long groupId,
317                    java.lang.String[] actionIds, long resourceId)
318                    throws com.liferay.portal.kernel.exception.PortalException,
319                            com.liferay.portal.kernel.exception.SystemException;
320    
321            public void setRolePermission(long roleId, long companyId,
322                    java.lang.String name, int scope, java.lang.String primKey,
323                    java.lang.String actionId)
324                    throws com.liferay.portal.kernel.exception.PortalException,
325                            com.liferay.portal.kernel.exception.SystemException;
326    
327            public void setRolePermissions(long roleId, long companyId,
328                    java.lang.String name, int scope, java.lang.String primKey,
329                    java.lang.String[] actionIds)
330                    throws com.liferay.portal.kernel.exception.PortalException,
331                            com.liferay.portal.kernel.exception.SystemException;
332    
333            public void setRolePermissions(long roleId, java.lang.String[] actionIds,
334                    long resourceId)
335                    throws com.liferay.portal.kernel.exception.PortalException,
336                            com.liferay.portal.kernel.exception.SystemException;
337    
338            public void setUserPermissions(long userId, java.lang.String[] actionIds,
339                    long resourceId)
340                    throws com.liferay.portal.kernel.exception.PortalException,
341                            com.liferay.portal.kernel.exception.SystemException;
342    
343            public void unsetRolePermission(long roleId, long permissionId)
344                    throws com.liferay.portal.kernel.exception.SystemException;
345    
346            public void unsetRolePermission(long roleId, long companyId,
347                    java.lang.String name, int scope, java.lang.String primKey,
348                    java.lang.String actionId)
349                    throws com.liferay.portal.kernel.exception.SystemException;
350    
351            public void unsetRolePermissions(long roleId, long companyId,
352                    java.lang.String name, int scope, java.lang.String actionId)
353                    throws com.liferay.portal.kernel.exception.SystemException;
354    
355            public void unsetUserPermissions(long userId, java.lang.String[] actionIds,
356                    long resourceId)
357                    throws com.liferay.portal.kernel.exception.SystemException;
358    }