001    /**
002     * Copyright (c) 2000-2011 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.exception.PortalException;
018    import com.liferay.portal.kernel.exception.SystemException;
019    import com.liferay.portal.kernel.transaction.Isolation;
020    import com.liferay.portal.kernel.transaction.Propagation;
021    import com.liferay.portal.kernel.transaction.Transactional;
022    
023    /**
024     * The interface for the permission local service.
025     *
026     * <p>
027     * 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.
028     * </p>
029     *
030     * @author Brian Wing Shun Chan
031     * @see PermissionLocalServiceUtil
032     * @see com.liferay.portal.service.base.PermissionLocalServiceBaseImpl
033     * @see com.liferay.portal.service.impl.PermissionLocalServiceImpl
034     * @generated
035     */
036    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
037            PortalException.class, SystemException.class})
038    public interface PermissionLocalService extends PersistedModelLocalService {
039            /*
040             * NOTE FOR DEVELOPERS:
041             *
042             * 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.
043             */
044    
045            /**
046            * Adds the permission to the database. Also notifies the appropriate model listeners.
047            *
048            * @param permission the permission
049            * @return the permission that was added
050            * @throws SystemException if a system exception occurred
051            */
052            public com.liferay.portal.model.Permission addPermission(
053                    com.liferay.portal.model.Permission permission)
054                    throws com.liferay.portal.kernel.exception.SystemException;
055    
056            /**
057            * Creates a new permission with the primary key. Does not add the permission to the database.
058            *
059            * @param permissionId the primary key for the new permission
060            * @return the new permission
061            */
062            public com.liferay.portal.model.Permission createPermission(
063                    long permissionId);
064    
065            /**
066            * Deletes the permission with the primary key from the database. Also notifies the appropriate model listeners.
067            *
068            * @param permissionId the primary key of the permission
069            * @throws PortalException if a permission with the primary key could not be found
070            * @throws SystemException if a system exception occurred
071            */
072            public void deletePermission(long permissionId)
073                    throws com.liferay.portal.kernel.exception.PortalException,
074                            com.liferay.portal.kernel.exception.SystemException;
075    
076            /**
077            * Deletes the permission from the database. Also notifies the appropriate model listeners.
078            *
079            * @param permission the permission
080            * @throws SystemException if a system exception occurred
081            */
082            public void deletePermission(com.liferay.portal.model.Permission permission)
083                    throws com.liferay.portal.kernel.exception.SystemException;
084    
085            /**
086            * Performs a dynamic query on the database and returns the matching rows.
087            *
088            * @param dynamicQuery the dynamic query
089            * @return the matching rows
090            * @throws SystemException if a system exception occurred
091            */
092            @SuppressWarnings("rawtypes")
093            public java.util.List dynamicQuery(
094                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
095                    throws com.liferay.portal.kernel.exception.SystemException;
096    
097            /**
098            * Performs a dynamic query on the database and returns a range of the matching rows.
099            *
100            * <p>
101            * 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.
102            * </p>
103            *
104            * @param dynamicQuery the dynamic query
105            * @param start the lower bound of the range of model instances
106            * @param end the upper bound of the range of model instances (not inclusive)
107            * @return the range of matching rows
108            * @throws SystemException if a system exception occurred
109            */
110            @SuppressWarnings("rawtypes")
111            public java.util.List dynamicQuery(
112                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
113                    int end) throws com.liferay.portal.kernel.exception.SystemException;
114    
115            /**
116            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
117            *
118            * <p>
119            * 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.
120            * </p>
121            *
122            * @param dynamicQuery the dynamic query
123            * @param start the lower bound of the range of model instances
124            * @param end the upper bound of the range of model instances (not inclusive)
125            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
126            * @return the ordered range of matching rows
127            * @throws SystemException if a system exception occurred
128            */
129            @SuppressWarnings("rawtypes")
130            public java.util.List dynamicQuery(
131                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
132                    int end,
133                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
134                    throws com.liferay.portal.kernel.exception.SystemException;
135    
136            /**
137            * Returns the number of rows that match the dynamic query.
138            *
139            * @param dynamicQuery the dynamic query
140            * @return the number of rows that match the dynamic query
141            * @throws SystemException if a system exception occurred
142            */
143            public long dynamicQueryCount(
144                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
145                    throws com.liferay.portal.kernel.exception.SystemException;
146    
147            /**
148            * Returns the permission with the primary key.
149            *
150            * @param permissionId the primary key of the permission
151            * @return the permission
152            * @throws PortalException if a permission with the primary key could not be found
153            * @throws SystemException if a system exception occurred
154            */
155            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
156            public com.liferay.portal.model.Permission getPermission(long permissionId)
157                    throws com.liferay.portal.kernel.exception.PortalException,
158                            com.liferay.portal.kernel.exception.SystemException;
159    
160            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
161            public com.liferay.portal.model.PersistedModel getPersistedModel(
162                    java.io.Serializable primaryKeyObj)
163                    throws com.liferay.portal.kernel.exception.PortalException,
164                            com.liferay.portal.kernel.exception.SystemException;
165    
166            /**
167            * Returns a range of all the permissions.
168            *
169            * <p>
170            * 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.
171            * </p>
172            *
173            * @param start the lower bound of the range of permissions
174            * @param end the upper bound of the range of permissions (not inclusive)
175            * @return the range of permissions
176            * @throws SystemException if a system exception occurred
177            */
178            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
179            public java.util.List<com.liferay.portal.model.Permission> getPermissions(
180                    int start, int end)
181                    throws com.liferay.portal.kernel.exception.SystemException;
182    
183            /**
184            * Returns the number of permissions.
185            *
186            * @return the number of permissions
187            * @throws SystemException if a system exception occurred
188            */
189            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
190            public int getPermissionsCount()
191                    throws com.liferay.portal.kernel.exception.SystemException;
192    
193            /**
194            * Updates the permission in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
195            *
196            * @param permission the permission
197            * @return the permission that was updated
198            * @throws SystemException if a system exception occurred
199            */
200            public com.liferay.portal.model.Permission updatePermission(
201                    com.liferay.portal.model.Permission permission)
202                    throws com.liferay.portal.kernel.exception.SystemException;
203    
204            /**
205            * Updates the permission in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
206            *
207            * @param permission the permission
208            * @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.
209            * @return the permission that was updated
210            * @throws SystemException if a system exception occurred
211            */
212            public com.liferay.portal.model.Permission updatePermission(
213                    com.liferay.portal.model.Permission permission, boolean merge)
214                    throws com.liferay.portal.kernel.exception.SystemException;
215    
216            /**
217            * Returns the Spring bean ID for this bean.
218            *
219            * @return the Spring bean ID for this bean
220            */
221            public java.lang.String getBeanIdentifier();
222    
223            /**
224            * Sets the Spring bean ID for this bean.
225            *
226            * @param beanIdentifier the Spring bean ID for this bean
227            */
228            public void setBeanIdentifier(java.lang.String beanIdentifier);
229    
230            public com.liferay.portal.model.Permission addPermission(long companyId,
231                    java.lang.String actionId, long resourceId)
232                    throws com.liferay.portal.kernel.exception.SystemException;
233    
234            public java.util.List<com.liferay.portal.model.Permission> addPermissions(
235                    long companyId, java.util.List<java.lang.String> actionIds,
236                    long resourceId)
237                    throws com.liferay.portal.kernel.exception.SystemException;
238    
239            public java.util.List<com.liferay.portal.model.Permission> addPermissions(
240                    long companyId, java.lang.String name, long resourceId,
241                    boolean portletActions)
242                    throws com.liferay.portal.kernel.exception.SystemException;
243    
244            public void addUserPermissions(long userId, java.lang.String[] actionIds,
245                    long resourceId)
246                    throws com.liferay.portal.kernel.exception.PortalException,
247                            com.liferay.portal.kernel.exception.SystemException;
248    
249            public void checkPermissions(java.lang.String name,
250                    java.util.List<java.lang.String> actionIds)
251                    throws com.liferay.portal.kernel.exception.PortalException,
252                            com.liferay.portal.kernel.exception.SystemException;
253    
254            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
255            public java.util.List<java.lang.String> getActions(
256                    java.util.List<com.liferay.portal.model.Permission> permissions);
257    
258            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
259            public java.util.List<com.liferay.portal.model.Permission> getGroupPermissions(
260                    long groupId, long resourceId)
261                    throws com.liferay.portal.kernel.exception.SystemException;
262    
263            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
264            public java.util.List<com.liferay.portal.model.Permission> getGroupPermissions(
265                    long groupId, long companyId, java.lang.String name, int scope,
266                    java.lang.String primKey)
267                    throws com.liferay.portal.kernel.exception.SystemException;
268    
269            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
270            public long getLatestPermissionId()
271                    throws com.liferay.portal.kernel.exception.SystemException;
272    
273            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
274            public java.util.List<com.liferay.portal.model.Permission> getOrgGroupPermissions(
275                    long organizationId, long groupId, long resourceId)
276                    throws com.liferay.portal.kernel.exception.SystemException;
277    
278            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
279            public java.util.List<com.liferay.portal.model.Permission> getPermissions(
280                    long companyId, java.lang.String[] actionIds, long resourceId)
281                    throws com.liferay.portal.kernel.exception.SystemException;
282    
283            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
284            public java.util.List<com.liferay.portal.model.Permission> getRolePermissions(
285                    long roleId) throws com.liferay.portal.kernel.exception.SystemException;
286    
287            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
288            public java.util.List<com.liferay.portal.model.Permission> getRolePermissions(
289                    long roleId, long resourceId)
290                    throws com.liferay.portal.kernel.exception.SystemException;
291    
292            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
293            public java.util.List<com.liferay.portal.model.Permission> getUserPermissions(
294                    long userId, long resourceId)
295                    throws com.liferay.portal.kernel.exception.SystemException;
296    
297            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
298            public java.util.List<com.liferay.portal.model.Permission> getUserPermissions(
299                    long userId, long companyId, java.lang.String name, int scope,
300                    java.lang.String primKey)
301                    throws com.liferay.portal.kernel.exception.SystemException;
302    
303            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
304            public boolean hasGroupPermission(long groupId, java.lang.String actionId,
305                    long resourceId)
306                    throws com.liferay.portal.kernel.exception.SystemException;
307    
308            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
309            public boolean hasRolePermission(long roleId, long companyId,
310                    java.lang.String name, int scope, java.lang.String actionId)
311                    throws com.liferay.portal.kernel.exception.SystemException;
312    
313            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
314            public boolean hasRolePermission(long roleId, long companyId,
315                    java.lang.String name, int scope, java.lang.String primKey,
316                    java.lang.String actionId)
317                    throws com.liferay.portal.kernel.exception.SystemException;
318    
319            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
320            public boolean hasUserPermission(long userId, java.lang.String actionId,
321                    long resourceId)
322                    throws com.liferay.portal.kernel.exception.SystemException;
323    
324            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
325            public boolean hasUserPermissions(long userId, long groupId,
326                    java.util.List<com.liferay.portal.model.Resource> resources,
327                    java.lang.String actionId,
328                    com.liferay.portal.security.permission.PermissionCheckerBag permissionCheckerBag)
329                    throws com.liferay.portal.kernel.exception.PortalException,
330                            com.liferay.portal.kernel.exception.SystemException;
331    
332            public void setContainerResourcePermissions(java.lang.String name,
333                    java.lang.String roleName, java.lang.String actionId)
334                    throws com.liferay.portal.kernel.exception.PortalException,
335                            com.liferay.portal.kernel.exception.SystemException;
336    
337            public void setGroupPermissions(long groupId, java.lang.String[] actionIds,
338                    long resourceId)
339                    throws com.liferay.portal.kernel.exception.PortalException,
340                            com.liferay.portal.kernel.exception.SystemException;
341    
342            public void setGroupPermissions(java.lang.String className,
343                    java.lang.String classPK, long groupId, java.lang.String[] actionIds,
344                    long resourceId)
345                    throws com.liferay.portal.kernel.exception.PortalException,
346                            com.liferay.portal.kernel.exception.SystemException;
347    
348            public void setOrgGroupPermissions(long organizationId, long groupId,
349                    java.lang.String[] actionIds, long resourceId)
350                    throws com.liferay.portal.kernel.exception.PortalException,
351                            com.liferay.portal.kernel.exception.SystemException;
352    
353            public void setRolePermission(long roleId, long companyId,
354                    java.lang.String name, int scope, java.lang.String primKey,
355                    java.lang.String actionId)
356                    throws com.liferay.portal.kernel.exception.PortalException,
357                            com.liferay.portal.kernel.exception.SystemException;
358    
359            public void setRolePermissions(long roleId, long companyId,
360                    java.lang.String name, int scope, java.lang.String primKey,
361                    java.lang.String[] actionIds)
362                    throws com.liferay.portal.kernel.exception.PortalException,
363                            com.liferay.portal.kernel.exception.SystemException;
364    
365            public void setRolePermissions(long roleId, java.lang.String[] actionIds,
366                    long resourceId)
367                    throws com.liferay.portal.kernel.exception.PortalException,
368                            com.liferay.portal.kernel.exception.SystemException;
369    
370            public void setUserPermissions(long userId, java.lang.String[] actionIds,
371                    long resourceId)
372                    throws com.liferay.portal.kernel.exception.PortalException,
373                            com.liferay.portal.kernel.exception.SystemException;
374    
375            public void unsetRolePermission(long roleId, long permissionId)
376                    throws com.liferay.portal.kernel.exception.SystemException;
377    
378            public void unsetRolePermission(long roleId, long companyId,
379                    java.lang.String name, int scope, java.lang.String primKey,
380                    java.lang.String actionId)
381                    throws com.liferay.portal.kernel.exception.SystemException;
382    
383            public void unsetRolePermissions(long roleId, long companyId,
384                    java.lang.String name, int scope, java.lang.String actionId)
385                    throws com.liferay.portal.kernel.exception.SystemException;
386    
387            public void unsetUserPermissions(long userId, java.lang.String[] actionIds,
388                    long resourceId)
389                    throws com.liferay.portal.kernel.exception.SystemException;
390    }