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;
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 BaseLocalService,
039            PersistedModelLocalService {
040            /*
041             * NOTE FOR DEVELOPERS:
042             *
043             * 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.
044             */
045    
046            /**
047            * Adds the permission to the database. Also notifies the appropriate model listeners.
048            *
049            * @param permission the permission
050            * @return the permission that was added
051            * @throws SystemException if a system exception occurred
052            */
053            public com.liferay.portal.model.Permission addPermission(
054                    com.liferay.portal.model.Permission permission)
055                    throws com.liferay.portal.kernel.exception.SystemException;
056    
057            /**
058            * Creates a new permission with the primary key. Does not add the permission to the database.
059            *
060            * @param permissionId the primary key for the new permission
061            * @return the new permission
062            */
063            public com.liferay.portal.model.Permission createPermission(
064                    long permissionId);
065    
066            /**
067            * Deletes the permission with the primary key from the database. Also notifies the appropriate model listeners.
068            *
069            * @param permissionId the primary key of the permission
070            * @return the permission that was removed
071            * @throws PortalException if a permission with the primary key could not be found
072            * @throws SystemException if a system exception occurred
073            */
074            public com.liferay.portal.model.Permission deletePermission(
075                    long permissionId)
076                    throws com.liferay.portal.kernel.exception.PortalException,
077                            com.liferay.portal.kernel.exception.SystemException;
078    
079            /**
080            * Deletes the permission from the database. Also notifies the appropriate model listeners.
081            *
082            * @param permission the permission
083            * @return the permission that was removed
084            * @throws SystemException if a system exception occurred
085            */
086            public com.liferay.portal.model.Permission deletePermission(
087                    com.liferay.portal.model.Permission permission)
088                    throws com.liferay.portal.kernel.exception.SystemException;
089    
090            public com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery();
091    
092            /**
093            * Performs a dynamic query on the database and returns the matching rows.
094            *
095            * @param dynamicQuery the dynamic query
096            * @return the matching rows
097            * @throws SystemException if a system exception occurred
098            */
099            @SuppressWarnings("rawtypes")
100            public java.util.List dynamicQuery(
101                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
102                    throws com.liferay.portal.kernel.exception.SystemException;
103    
104            /**
105            * Performs a dynamic query on the database and returns a range of the matching rows.
106            *
107            * <p>
108            * 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.
109            * </p>
110            *
111            * @param dynamicQuery the dynamic query
112            * @param start the lower bound of the range of model instances
113            * @param end the upper bound of the range of model instances (not inclusive)
114            * @return the range of matching rows
115            * @throws SystemException if a system exception occurred
116            */
117            @SuppressWarnings("rawtypes")
118            public java.util.List dynamicQuery(
119                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
120                    int end) throws com.liferay.portal.kernel.exception.SystemException;
121    
122            /**
123            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
124            *
125            * <p>
126            * 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.
127            * </p>
128            *
129            * @param dynamicQuery the dynamic query
130            * @param start the lower bound of the range of model instances
131            * @param end the upper bound of the range of model instances (not inclusive)
132            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
133            * @return the ordered range of matching rows
134            * @throws SystemException if a system exception occurred
135            */
136            @SuppressWarnings("rawtypes")
137            public java.util.List dynamicQuery(
138                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
139                    int end,
140                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
141                    throws com.liferay.portal.kernel.exception.SystemException;
142    
143            /**
144            * Returns the number of rows that match the dynamic query.
145            *
146            * @param dynamicQuery the dynamic query
147            * @return the number of rows that match the dynamic query
148            * @throws SystemException if a system exception occurred
149            */
150            public long dynamicQueryCount(
151                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
152                    throws com.liferay.portal.kernel.exception.SystemException;
153    
154            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
155            public com.liferay.portal.model.Permission fetchPermission(
156                    long permissionId)
157                    throws com.liferay.portal.kernel.exception.SystemException;
158    
159            /**
160            * Returns the permission with the primary key.
161            *
162            * @param permissionId the primary key of the permission
163            * @return the permission
164            * @throws PortalException if a permission with the primary key could not be found
165            * @throws SystemException if a system exception occurred
166            */
167            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
168            public com.liferay.portal.model.Permission getPermission(long permissionId)
169                    throws com.liferay.portal.kernel.exception.PortalException,
170                            com.liferay.portal.kernel.exception.SystemException;
171    
172            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
173            public com.liferay.portal.model.PersistedModel getPersistedModel(
174                    java.io.Serializable primaryKeyObj)
175                    throws com.liferay.portal.kernel.exception.PortalException,
176                            com.liferay.portal.kernel.exception.SystemException;
177    
178            /**
179            * Returns a range of all the permissions.
180            *
181            * <p>
182            * 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.
183            * </p>
184            *
185            * @param start the lower bound of the range of permissions
186            * @param end the upper bound of the range of permissions (not inclusive)
187            * @return the range of permissions
188            * @throws SystemException if a system exception occurred
189            */
190            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
191            public java.util.List<com.liferay.portal.model.Permission> getPermissions(
192                    int start, int end)
193                    throws com.liferay.portal.kernel.exception.SystemException;
194    
195            /**
196            * Returns the number of permissions.
197            *
198            * @return the number of permissions
199            * @throws SystemException if a system exception occurred
200            */
201            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
202            public int getPermissionsCount()
203                    throws com.liferay.portal.kernel.exception.SystemException;
204    
205            /**
206            * Updates the permission in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
207            *
208            * @param permission the permission
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)
214                    throws com.liferay.portal.kernel.exception.SystemException;
215    
216            /**
217            * Updates the permission in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
218            *
219            * @param permission the permission
220            * @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.
221            * @return the permission that was updated
222            * @throws SystemException if a system exception occurred
223            */
224            public com.liferay.portal.model.Permission updatePermission(
225                    com.liferay.portal.model.Permission permission, boolean merge)
226                    throws com.liferay.portal.kernel.exception.SystemException;
227    
228            /**
229            * @throws SystemException if a system exception occurred
230            */
231            public void addGroupPermission(long groupId, long permissionId)
232                    throws com.liferay.portal.kernel.exception.SystemException;
233    
234            /**
235            * @throws SystemException if a system exception occurred
236            */
237            public void addGroupPermission(long groupId,
238                    com.liferay.portal.model.Permission permission)
239                    throws com.liferay.portal.kernel.exception.SystemException;
240    
241            /**
242            * @throws SystemException if a system exception occurred
243            */
244            public void addGroupPermissions(long groupId, long[] permissionIds)
245                    throws com.liferay.portal.kernel.exception.SystemException;
246    
247            /**
248            * @throws SystemException if a system exception occurred
249            */
250            public void addGroupPermissions(long groupId,
251                    java.util.List<com.liferay.portal.model.Permission> Permissions)
252                    throws com.liferay.portal.kernel.exception.SystemException;
253    
254            /**
255            * @throws SystemException if a system exception occurred
256            */
257            public void clearGroupPermissions(long groupId)
258                    throws com.liferay.portal.kernel.exception.SystemException;
259    
260            /**
261            * @throws SystemException if a system exception occurred
262            */
263            public void deleteGroupPermission(long groupId, long permissionId)
264                    throws com.liferay.portal.kernel.exception.SystemException;
265    
266            /**
267            * @throws SystemException if a system exception occurred
268            */
269            public void deleteGroupPermission(long groupId,
270                    com.liferay.portal.model.Permission permission)
271                    throws com.liferay.portal.kernel.exception.SystemException;
272    
273            /**
274            * @throws SystemException if a system exception occurred
275            */
276            public void deleteGroupPermissions(long groupId, long[] permissionIds)
277                    throws com.liferay.portal.kernel.exception.SystemException;
278    
279            /**
280            * @throws SystemException if a system exception occurred
281            */
282            public void deleteGroupPermissions(long groupId,
283                    java.util.List<com.liferay.portal.model.Permission> Permissions)
284                    throws com.liferay.portal.kernel.exception.SystemException;
285    
286            /**
287            * @throws SystemException if a system exception occurred
288            */
289            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
290            public java.util.List<com.liferay.portal.model.Permission> getGroupPermissions(
291                    long groupId)
292                    throws com.liferay.portal.kernel.exception.SystemException;
293    
294            /**
295            * @throws SystemException if a system exception occurred
296            */
297            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
298            public java.util.List<com.liferay.portal.model.Permission> getGroupPermissions(
299                    long groupId, int start, int end)
300                    throws com.liferay.portal.kernel.exception.SystemException;
301    
302            /**
303            * @throws SystemException if a system exception occurred
304            */
305            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
306            public java.util.List<com.liferay.portal.model.Permission> getGroupPermissions(
307                    long groupId, int start, int end,
308                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
309                    throws com.liferay.portal.kernel.exception.SystemException;
310    
311            /**
312            * @throws SystemException if a system exception occurred
313            */
314            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
315            public int getGroupPermissionsCount(long groupId)
316                    throws com.liferay.portal.kernel.exception.SystemException;
317    
318            /**
319            * @throws SystemException if a system exception occurred
320            */
321            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
322            public boolean hasGroupPermission(long groupId, long permissionId)
323                    throws com.liferay.portal.kernel.exception.SystemException;
324    
325            /**
326            * @throws SystemException if a system exception occurred
327            */
328            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
329            public boolean hasGroupPermissions(long groupId)
330                    throws com.liferay.portal.kernel.exception.SystemException;
331    
332            /**
333            * @throws SystemException if a system exception occurred
334            */
335            public void setGroupPermissions(long groupId, long[] permissionIds)
336                    throws com.liferay.portal.kernel.exception.SystemException;
337    
338            /**
339            * @throws SystemException if a system exception occurred
340            */
341            public void addRolePermission(long roleId, long permissionId)
342                    throws com.liferay.portal.kernel.exception.SystemException;
343    
344            /**
345            * @throws SystemException if a system exception occurred
346            */
347            public void addRolePermission(long roleId,
348                    com.liferay.portal.model.Permission permission)
349                    throws com.liferay.portal.kernel.exception.SystemException;
350    
351            /**
352            * @throws SystemException if a system exception occurred
353            */
354            public void addRolePermissions(long roleId, long[] permissionIds)
355                    throws com.liferay.portal.kernel.exception.SystemException;
356    
357            /**
358            * @throws SystemException if a system exception occurred
359            */
360            public void addRolePermissions(long roleId,
361                    java.util.List<com.liferay.portal.model.Permission> Permissions)
362                    throws com.liferay.portal.kernel.exception.SystemException;
363    
364            /**
365            * @throws SystemException if a system exception occurred
366            */
367            public void clearRolePermissions(long roleId)
368                    throws com.liferay.portal.kernel.exception.SystemException;
369    
370            /**
371            * @throws SystemException if a system exception occurred
372            */
373            public void deleteRolePermission(long roleId, long permissionId)
374                    throws com.liferay.portal.kernel.exception.SystemException;
375    
376            /**
377            * @throws SystemException if a system exception occurred
378            */
379            public void deleteRolePermission(long roleId,
380                    com.liferay.portal.model.Permission permission)
381                    throws com.liferay.portal.kernel.exception.SystemException;
382    
383            /**
384            * @throws SystemException if a system exception occurred
385            */
386            public void deleteRolePermissions(long roleId, long[] permissionIds)
387                    throws com.liferay.portal.kernel.exception.SystemException;
388    
389            /**
390            * @throws SystemException if a system exception occurred
391            */
392            public void deleteRolePermissions(long roleId,
393                    java.util.List<com.liferay.portal.model.Permission> Permissions)
394                    throws com.liferay.portal.kernel.exception.SystemException;
395    
396            /**
397            * @throws SystemException if a system exception occurred
398            */
399            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
400            public java.util.List<com.liferay.portal.model.Permission> getRolePermissions(
401                    long roleId) throws com.liferay.portal.kernel.exception.SystemException;
402    
403            /**
404            * @throws SystemException if a system exception occurred
405            */
406            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
407            public java.util.List<com.liferay.portal.model.Permission> getRolePermissions(
408                    long roleId, int start, int end)
409                    throws com.liferay.portal.kernel.exception.SystemException;
410    
411            /**
412            * @throws SystemException if a system exception occurred
413            */
414            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
415            public java.util.List<com.liferay.portal.model.Permission> getRolePermissions(
416                    long roleId, int start, int end,
417                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
418                    throws com.liferay.portal.kernel.exception.SystemException;
419    
420            /**
421            * @throws SystemException if a system exception occurred
422            */
423            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
424            public int getRolePermissionsCount(long roleId)
425                    throws com.liferay.portal.kernel.exception.SystemException;
426    
427            /**
428            * @throws SystemException if a system exception occurred
429            */
430            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
431            public boolean hasRolePermission(long roleId, long permissionId)
432                    throws com.liferay.portal.kernel.exception.SystemException;
433    
434            /**
435            * @throws SystemException if a system exception occurred
436            */
437            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
438            public boolean hasRolePermissions(long roleId)
439                    throws com.liferay.portal.kernel.exception.SystemException;
440    
441            /**
442            * @throws SystemException if a system exception occurred
443            */
444            public void setRolePermissions(long roleId, long[] permissionIds)
445                    throws com.liferay.portal.kernel.exception.SystemException;
446    
447            /**
448            * @throws SystemException if a system exception occurred
449            */
450            public void addUserPermission(long userId, long permissionId)
451                    throws com.liferay.portal.kernel.exception.SystemException;
452    
453            /**
454            * @throws SystemException if a system exception occurred
455            */
456            public void addUserPermission(long userId,
457                    com.liferay.portal.model.Permission permission)
458                    throws com.liferay.portal.kernel.exception.SystemException;
459    
460            /**
461            * @throws SystemException if a system exception occurred
462            */
463            public void addUserPermissions(long userId, long[] permissionIds)
464                    throws com.liferay.portal.kernel.exception.SystemException;
465    
466            /**
467            * @throws SystemException if a system exception occurred
468            */
469            public void addUserPermissions(long userId,
470                    java.util.List<com.liferay.portal.model.Permission> Permissions)
471                    throws com.liferay.portal.kernel.exception.SystemException;
472    
473            /**
474            * @throws SystemException if a system exception occurred
475            */
476            public void clearUserPermissions(long userId)
477                    throws com.liferay.portal.kernel.exception.SystemException;
478    
479            /**
480            * @throws SystemException if a system exception occurred
481            */
482            public void deleteUserPermission(long userId, long permissionId)
483                    throws com.liferay.portal.kernel.exception.SystemException;
484    
485            /**
486            * @throws SystemException if a system exception occurred
487            */
488            public void deleteUserPermission(long userId,
489                    com.liferay.portal.model.Permission permission)
490                    throws com.liferay.portal.kernel.exception.SystemException;
491    
492            /**
493            * @throws SystemException if a system exception occurred
494            */
495            public void deleteUserPermissions(long userId, long[] permissionIds)
496                    throws com.liferay.portal.kernel.exception.SystemException;
497    
498            /**
499            * @throws SystemException if a system exception occurred
500            */
501            public void deleteUserPermissions(long userId,
502                    java.util.List<com.liferay.portal.model.Permission> Permissions)
503                    throws com.liferay.portal.kernel.exception.SystemException;
504    
505            /**
506            * @throws SystemException if a system exception occurred
507            */
508            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
509            public java.util.List<com.liferay.portal.model.Permission> getUserPermissions(
510                    long userId) throws com.liferay.portal.kernel.exception.SystemException;
511    
512            /**
513            * @throws SystemException if a system exception occurred
514            */
515            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
516            public java.util.List<com.liferay.portal.model.Permission> getUserPermissions(
517                    long userId, int start, int end)
518                    throws com.liferay.portal.kernel.exception.SystemException;
519    
520            /**
521            * @throws SystemException if a system exception occurred
522            */
523            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
524            public java.util.List<com.liferay.portal.model.Permission> getUserPermissions(
525                    long userId, int start, int end,
526                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
527                    throws com.liferay.portal.kernel.exception.SystemException;
528    
529            /**
530            * @throws SystemException if a system exception occurred
531            */
532            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
533            public int getUserPermissionsCount(long userId)
534                    throws com.liferay.portal.kernel.exception.SystemException;
535    
536            /**
537            * @throws SystemException if a system exception occurred
538            */
539            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
540            public boolean hasUserPermission(long userId, long permissionId)
541                    throws com.liferay.portal.kernel.exception.SystemException;
542    
543            /**
544            * @throws SystemException if a system exception occurred
545            */
546            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
547            public boolean hasUserPermissions(long userId)
548                    throws com.liferay.portal.kernel.exception.SystemException;
549    
550            /**
551            * @throws SystemException if a system exception occurred
552            */
553            public void setUserPermissions(long userId, long[] permissionIds)
554                    throws com.liferay.portal.kernel.exception.SystemException;
555    
556            /**
557            * Returns the Spring bean ID for this bean.
558            *
559            * @return the Spring bean ID for this bean
560            */
561            public java.lang.String getBeanIdentifier();
562    
563            /**
564            * Sets the Spring bean ID for this bean.
565            *
566            * @param beanIdentifier the Spring bean ID for this bean
567            */
568            public void setBeanIdentifier(java.lang.String beanIdentifier);
569    
570            /**
571            * Adds a permission to perform the action on the resource.
572            *
573            * <p>
574            * This method will retrieve the permission of the company, action, and
575            * resource with the primary keys. The method creates the permission if it
576            * fails to retrieve it.
577            * </p>
578            *
579            * @param companyId the primary key of the company
580            * @param actionId the action's ID
581            * @param resourceId the primary key of the resource
582            * @return the permission of the company, action, and resource with the
583            primary keys
584            * @throws SystemException if a system exception occurred
585            */
586            public com.liferay.portal.model.Permission addPermission(long companyId,
587                    java.lang.String actionId, long resourceId)
588                    throws com.liferay.portal.kernel.exception.SystemException;
589    
590            /**
591            * Adds permissions to perform the actions on the resource.
592            *
593            * <p>
594            * This method will retrieve the permissions of the company, actions, and
595            * resource with the primary keys. The method creates any permissions it
596            * fails to retrieve.
597            * </p>
598            *
599            * @param companyId the primary key of the company
600            * @param actionIds the primary keys of the actions
601            * @param resourceId the primary key of the resource
602            * @return the permissions to perform the actions on the resource
603            * @throws SystemException if a system exception occurred
604            */
605            public java.util.List<com.liferay.portal.model.Permission> addPermissions(
606                    long companyId, java.util.List<java.lang.String> actionIds,
607                    long resourceId)
608                    throws com.liferay.portal.kernel.exception.SystemException;
609    
610            /**
611            * Adds permissions to perform either the portlet resource actions or model
612            * resource actions on the resource.
613            *
614            * <p>
615            * This method will retrieve the permissions of the company, actions, and
616            * resource with the primary keys. The method creates any permissions it
617            * fails to retrieve.
618            * </p>
619            *
620            * @param companyId the primary key of the company
621            * @param name the resource name
622            * @param resourceId the primary key of the resource
623            * @param portletActions whether to retrieve the action primary keys from
624            the portlet or the model resource
625            * @return the permissions to perform the actions on the resource
626            * @throws SystemException if a system exception occurred
627            */
628            public java.util.List<com.liferay.portal.model.Permission> addPermissions(
629                    long companyId, java.lang.String name, long resourceId,
630                    boolean portletActions)
631                    throws com.liferay.portal.kernel.exception.SystemException;
632    
633            /**
634            * Adds user permissions to perform the actions on the resource.
635            *
636            * @param userId the primary key of the user
637            * @param actionIds the primary keys of the actions
638            * @param resourceId the primary key of the resource
639            * @throws PortalException if a user with the primary key could not be found
640            * @throws SystemException if a system exception occurred
641            */
642            public void addUserPermissions(long userId, java.lang.String[] actionIds,
643                    long resourceId)
644                    throws com.liferay.portal.kernel.exception.PortalException,
645                            com.liferay.portal.kernel.exception.SystemException;
646    
647            /**
648            * Checks to see if the actions are permitted on the named resource.
649            *
650            * @param name the resource name
651            * @param actionIds the primary keys of the actions
652            * @throws PortalException if the resource company or name could not be
653            found or were invalid
654            * @throws SystemException if a system exception occurred
655            */
656            public void checkPermissions(java.lang.String name,
657                    java.util.List<java.lang.String> actionIds)
658                    throws com.liferay.portal.kernel.exception.PortalException,
659                            com.liferay.portal.kernel.exception.SystemException;
660    
661            /**
662            * Returns the IDs of all the actions belonging to the permissions.
663            *
664            * @param permissions the permissions
665            * @return the IDs of all the actions belonging to the permissions
666            */
667            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
668            public java.util.List<java.lang.String> getActions(
669                    java.util.List<com.liferay.portal.model.Permission> permissions);
670    
671            /**
672            * Returns all the group's permissions on the resource.
673            *
674            * @param groupId the primary key of the group
675            * @param resourceId the primary key of the resource
676            * @return the group's permissions on the resource
677            * @throws SystemException if a system exception occurred
678            */
679            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
680            public java.util.List<com.liferay.portal.model.Permission> getGroupPermissions(
681                    long groupId, long resourceId)
682                    throws com.liferay.portal.kernel.exception.SystemException;
683    
684            /**
685            * Returns all the group's permissions on the named resource with the scope
686            * and primKey.
687            *
688            * @param groupId the primary key of the group
689            * @param companyId the primary key of the company
690            * @param name the resource name
691            * @param scope the resource scope
692            * @param primKey the resource primKey
693            * @return the group's permissions on the named resource with the scope and
694            primKey
695            * @throws SystemException if a system exception occurred
696            */
697            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
698            public java.util.List<com.liferay.portal.model.Permission> getGroupPermissions(
699                    long groupId, long companyId, java.lang.String name, int scope,
700                    java.lang.String primKey)
701                    throws com.liferay.portal.kernel.exception.SystemException;
702    
703            /**
704            * Returns the primary key of the latest permission created.
705            *
706            * @return the primary key of the latest permission created
707            * @throws SystemException if a system exception occurred
708            */
709            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
710            public long getLatestPermissionId()
711                    throws com.liferay.portal.kernel.exception.SystemException;
712    
713            /**
714            * Returns all the permissions of the organization's group with respect to
715            * the resource.
716            *
717            * @param organizationId the primary key of the organization
718            * @param groupId the primary key of the group
719            * @param resourceId the primary key of the resource
720            * @return the permissions of the organization's group with respect to the
721            resource
722            * @throws SystemException if a system exception occurred
723            */
724            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
725            public java.util.List<com.liferay.portal.model.Permission> getOrgGroupPermissions(
726                    long organizationId, long groupId, long resourceId)
727                    throws com.liferay.portal.kernel.exception.SystemException;
728    
729            /**
730            * Returns all the permissions to perform the actions on the resource,
731            * creating new permissions for any permissions not found.
732            *
733            * @param companyId the primary key of the company
734            * @param actionIds the primary keys of the actions
735            * @param resourceId the primary key of the resource
736            * @return the permissions to perform the actions on the resource
737            * @throws SystemException if a system exception occurred
738            * @see #addPermission(long, String, long)
739            */
740            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
741            public java.util.List<com.liferay.portal.model.Permission> getPermissions(
742                    long companyId, java.lang.String[] actionIds, long resourceId)
743                    throws com.liferay.portal.kernel.exception.SystemException;
744    
745            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
746            public java.util.List<com.liferay.portal.model.Permission> getRolePermissions(
747                    long roleId, int[] scopes)
748                    throws com.liferay.portal.kernel.exception.SystemException;
749    
750            /**
751            * Returns all the role's permissions on the resource.
752            *
753            * @param roleId the primary key of the role
754            * @param resourceId the primary key of the resource
755            * @return the role's permissions on the resource
756            * @throws SystemException if a system exception occurred
757            */
758            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
759            public java.util.List<com.liferay.portal.model.Permission> getRolePermissions(
760                    long roleId, long resourceId)
761                    throws com.liferay.portal.kernel.exception.SystemException;
762    
763            /**
764            * Returns all the user's permissions on the resource.
765            *
766            * @param userId the primary key of the user
767            * @param resourceId the primary key of the resource
768            * @return the user's permissions on the resource
769            * @throws SystemException if a system exception occurred
770            */
771            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
772            public java.util.List<com.liferay.portal.model.Permission> getUserPermissions(
773                    long userId, long resourceId)
774                    throws com.liferay.portal.kernel.exception.SystemException;
775    
776            /**
777            * Returns all the user's permissions on the named resource with the scope
778            * and primKey.
779            *
780            * @param userId the primary key of the user
781            * @param companyId the primary key of the company
782            * @param name the resource name
783            * @param scope the resource scope
784            * @param primKey the resource primKey
785            * @return the user permissions of the resource name, scope, and primKey
786            * @throws SystemException if a system exception occurred
787            */
788            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
789            public java.util.List<com.liferay.portal.model.Permission> getUserPermissions(
790                    long userId, long companyId, java.lang.String name, int scope,
791                    java.lang.String primKey)
792                    throws com.liferay.portal.kernel.exception.SystemException;
793    
794            /**
795            * Returns <code>true</code> if the group has permission to perform the
796            * action on the resource.
797            *
798            * @param groupId the primary key of the group
799            * @param actionId the action's ID
800            * @param resourceId the primary key of the resource
801            * @return <code>true</code> if the group has permission to perform the
802            action on the resource; <code>false</code> otherwise
803            * @throws SystemException if a system exception occurred
804            */
805            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
806            public boolean hasGroupPermission(long groupId, java.lang.String actionId,
807                    long resourceId)
808                    throws com.liferay.portal.kernel.exception.SystemException;
809    
810            /**
811            * Returns <code>true</code> if the role has permission to perform the
812            * action on the named resource with the scope.
813            *
814            * @param roleId the primary key of the role
815            * @param companyId the primary key of the company
816            * @param name the resource name
817            * @param scope the resource scope
818            * @param actionId the action's ID
819            * @return <code>true</code> if the role has permission to perform the
820            action on the named resource with the scope; <code>false</code>
821            otherwise
822            * @throws SystemException if a system exception occurred
823            */
824            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
825            public boolean hasRolePermission(long roleId, long companyId,
826                    java.lang.String name, int scope, java.lang.String actionId)
827                    throws com.liferay.portal.kernel.exception.SystemException;
828    
829            /**
830            * Returns <code>true</code> if the role has permission to perform the
831            * action on the named resource with the scope and primKey.
832            *
833            * @param roleId the primary key of the role
834            * @param companyId the primary key of the company
835            * @param name the resource name
836            * @param scope the resource scope
837            * @param primKey the resource primKey
838            * @param actionId the action's ID
839            * @return <code>true</code> if the role has permission to perform the
840            action on the named resource with the scope and primKey;
841            <code>false</code> otherwise
842            * @throws SystemException if a system exception occurred
843            */
844            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
845            public boolean hasRolePermission(long roleId, long companyId,
846                    java.lang.String name, int scope, java.lang.String primKey,
847                    java.lang.String actionId)
848                    throws com.liferay.portal.kernel.exception.SystemException;
849    
850            /**
851            * Returns <code>true</code> if the user has permission to perform the
852            * action on the resource.
853            *
854            * @param userId the primary key of the user
855            * @param actionId the action's ID
856            * @param resourceId the primary key of the resource
857            * @return <code>true</code> if the user has permission to perform the
858            action on the resource; <code>false</code> otherwise
859            * @throws SystemException if a system exception occurred
860            */
861            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
862            public boolean hasUserPermission(long userId, java.lang.String actionId,
863                    long resourceId)
864                    throws com.liferay.portal.kernel.exception.SystemException;
865    
866            /**
867            * Returns <code>true</code> if the user has permission to perform the
868            * action on the resources.
869            *
870            * <p>
871            * This method does not support resources managed by the resource block
872            * system.
873            * </p>
874            *
875            * @param userId the primary key of the user
876            * @param groupId the primary key of the group containing the resource
877            * @param resources representations of the resource at each scope level
878            returned by {@link
879            com.liferay.portal.security.permission.AdvancedPermissionChecker#getResources(
880            long, long, String, String, String)}
881            * @param actionId the action's ID
882            * @param permissionCheckerBag the permission checker bag
883            * @return <code>true</code> if the user has permission to perform the
884            action on the resources; <code>false</code> otherwise
885            * @throws PortalException if a resource action based on any one of the
886            resources and the action ID could not be found
887            * @throws SystemException if a system exception occurred
888            */
889            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
890            public boolean hasUserPermissions(long userId, long groupId,
891                    java.util.List<com.liferay.portal.model.Resource> resources,
892                    java.lang.String actionId,
893                    com.liferay.portal.security.permission.PermissionCheckerBag permissionCheckerBag)
894                    throws com.liferay.portal.kernel.exception.PortalException,
895                            com.liferay.portal.kernel.exception.SystemException;
896    
897            /**
898            * Sets the container wide permissions of either the role or the default
899            * user of each company to perform the actions on the named resource.
900            *
901            * @param name the resource name
902            * @param roleName the role name. Supported role names include {@link
903            com.liferay.portal.model.RoleConstants#ORGANIZATION_USER}, {@link
904            com.liferay.portal.model.RoleConstants#OWNER}, and {@link
905            com.liferay.portal.model.RoleConstants#SITE_MEMBER}.
906            * @param actionId the action's ID
907            * @throws PortalException if a matching role could not be found or if a
908            default user for the company could not be found
909            * @throws SystemException if a system exception occurred
910            */
911            public void setContainerResourcePermissions(java.lang.String name,
912                    java.lang.String roleName, java.lang.String actionId)
913                    throws com.liferay.portal.kernel.exception.PortalException,
914                            com.liferay.portal.kernel.exception.SystemException;
915    
916            /**
917            * Sets the group's permissions to perform the actions on the resource,
918            * replacing the group's existing permissions on the resource.
919            *
920            * @param groupId the primary key of the group
921            * @param actionIds the primary keys of the actions
922            * @param resourceId the primary key of the resource
923            * @throws PortalException if a group with the primary key could not be
924            found
925            * @throws SystemException if a system exception occurred
926            */
927            public void setGroupPermissions(long groupId, java.lang.String[] actionIds,
928                    long resourceId)
929                    throws com.liferay.portal.kernel.exception.PortalException,
930                            com.liferay.portal.kernel.exception.SystemException;
931    
932            /**
933            * Sets the entity's group permissions to perform the actions on the
934            * resource, replacing the entity's existing group permissions on the
935            * resource. Only {@link com.liferay.portal.model.Organization} and {@link
936            * com.liferay.portal.model.UserGroup} class entities are supported.
937            *
938            * @param className the class name of an organization or user group
939            * @param classPK the primary key of the class
940            * @param groupId the primary key of the group
941            * @param actionIds the primary keys of the actions
942            * @param resourceId the primary key of the resource
943            * @throws PortalException if an entity with the class name and primary key
944            could not be found or if the entity's associated group could not
945            be found
946            * @throws SystemException if a system exception occurred
947            */
948            public void setGroupPermissions(java.lang.String className,
949                    java.lang.String classPK, long groupId, java.lang.String[] actionIds,
950                    long resourceId)
951                    throws com.liferay.portal.kernel.exception.PortalException,
952                            com.liferay.portal.kernel.exception.SystemException;
953    
954            /**
955            * Sets the organization's group permissions to perform the actions on the
956            * resource, replacing the organization's existing group permissions on the
957            * resource.
958            *
959            * @param organizationId the primary key of the organization
960            * @param groupId the primary key of the group in which to scope the
961            permissions
962            * @param actionIds the primary keys of the actions
963            * @param resourceId the primary key of the resource
964            * @throws PortalException if an organization with the primary key could not
965            be found
966            * @throws SystemException if a system exception occurred
967            */
968            public void setOrgGroupPermissions(long organizationId, long groupId,
969                    java.lang.String[] actionIds, long resourceId)
970                    throws com.liferay.portal.kernel.exception.PortalException,
971                            com.liferay.portal.kernel.exception.SystemException;
972    
973            /**
974            * Sets the role's permissions to perform the action on the named resource,
975            * replacing the role's existing permissions on the resource.
976            *
977            * @param roleId the primary key of the role
978            * @param companyId the primary key of the company
979            * @param name the resource name
980            * @param scope the resource scope
981            * @param primKey the resource primKey
982            * @param actionId the action's ID
983            * @throws PortalException if the scope was {@link
984            com.liferay.portal.model.ResourceConstants#SCOPE_INDIVIDUAL}
985            * @throws SystemException if a system exception occurred
986            */
987            public void setRolePermission(long roleId, long companyId,
988                    java.lang.String name, int scope, java.lang.String primKey,
989                    java.lang.String actionId)
990                    throws com.liferay.portal.kernel.exception.PortalException,
991                            com.liferay.portal.kernel.exception.SystemException;
992    
993            /**
994            * Sets the role's permissions to perform the actions on the named resource,
995            * replacing the role's existing permission for each of these actions on the
996            * resource.
997            *
998            * @param roleId the primary key of the role
999            * @param companyId the primary key of the company
1000            * @param name the resource name
1001            * @param scope the resource scope
1002            * @param primKey the resource primKey
1003            * @param actionIds the primary keys of the actions
1004            * @throws PortalException if the scope was {@link
1005            com.liferay.portal.model.ResourceConstants#SCOPE_INDIVIDUAL}
1006            * @throws SystemException if a system exception occurred
1007            */
1008            public void setRolePermissions(long roleId, long companyId,
1009                    java.lang.String name, int scope, java.lang.String primKey,
1010                    java.lang.String[] actionIds)
1011                    throws com.liferay.portal.kernel.exception.PortalException,
1012                            com.liferay.portal.kernel.exception.SystemException;
1013    
1014            /**
1015            * Sets the role's permissions to perform the actions on the resource,
1016            * replacing the role's existing permissions on the resource.
1017            *
1018            * @param roleId the primary key of the role
1019            * @param actionIds the primary keys of the actions
1020            * @param resourceId the primary key of the resource
1021            * @throws PortalException if a role with the primary key could not be found
1022            * @throws SystemException if a system exception occurred
1023            */
1024            public void setRolePermissions(long roleId, java.lang.String[] actionIds,
1025                    long resourceId)
1026                    throws com.liferay.portal.kernel.exception.PortalException,
1027                            com.liferay.portal.kernel.exception.SystemException;
1028    
1029            /**
1030            * Sets the permissions of each role to perform respective actions on the
1031            * resource, replacing the existing permissions of each role on the
1032            * resource.
1033            *
1034            * @param companyId the primary key of the company
1035            * @param roleIdsToActionIds the map of roles to their new actions on the
1036            resource
1037            * @param resourceId the primary key of the resource
1038            * @throws SystemException if a system exception occurred
1039            */
1040            public void setRolesPermissions(long companyId,
1041                    java.util.Map<java.lang.Long, java.lang.String[]> roleIdsToActionIds,
1042                    long resourceId)
1043                    throws com.liferay.portal.kernel.exception.SystemException;
1044    
1045            /**
1046            * Sets the permissions of each role to perform respective actions on the
1047            * named resource, replacing the existing permissions of each role on the
1048            * resource.
1049            *
1050            * @param companyId the primary key of the company
1051            * @param roleIdsToActionIds the map of roles to their new actions on the
1052            resource
1053            * @param name the resource name
1054            * @param scope the resource scope
1055            * @param primKey the resource primKey
1056            * @throws SystemException if a system exception occurred
1057            */
1058            public void setRolesPermissions(long companyId,
1059                    java.util.Map<java.lang.Long, java.lang.String[]> roleIdsToActionIds,
1060                    java.lang.String name, int scope, java.lang.String primKey)
1061                    throws com.liferay.portal.kernel.exception.SystemException;
1062    
1063            /**
1064            * Sets the user's permissions to perform the actions on the resource,
1065            * replacing the user's existing permissions on the resource.
1066            *
1067            * @param userId the primary key of the user
1068            * @param actionIds the primary keys of the actions
1069            * @param resourceId the primary key of the resource
1070            * @throws PortalException if a user with the primary key could not be found
1071            * @throws SystemException if a system exception occurred
1072            */
1073            public void setUserPermissions(long userId, java.lang.String[] actionIds,
1074                    long resourceId)
1075                    throws com.liferay.portal.kernel.exception.PortalException,
1076                            com.liferay.portal.kernel.exception.SystemException;
1077    
1078            /**
1079            * Removes the permission from the role.
1080            *
1081            * @param roleId the primary key of the role
1082            * @param permissionId the primary key of the permission
1083            * @throws SystemException if a system exception occurred
1084            */
1085            public void unsetRolePermission(long roleId, long permissionId)
1086                    throws com.liferay.portal.kernel.exception.SystemException;
1087    
1088            /**
1089            * Removes the role's permissions to perform the action on the named
1090            * resource with the scope and primKey.
1091            *
1092            * @param roleId the primary key of the role
1093            * @param companyId the primary key of the company
1094            * @param name the resource name
1095            * @param scope the resource scope
1096            * @param primKey the resource primKey
1097            * @param actionId the action's ID
1098            * @throws SystemException if a system exception occurred
1099            */
1100            public void unsetRolePermission(long roleId, long companyId,
1101                    java.lang.String name, int scope, java.lang.String primKey,
1102                    java.lang.String actionId)
1103                    throws com.liferay.portal.kernel.exception.SystemException;
1104    
1105            /**
1106            * Removes the role's permissions to perform the action on the named
1107            * resource.
1108            *
1109            * @param roleId the primary key of the role
1110            * @param companyId the primary key of the company
1111            * @param name the resource name
1112            * @param scope the resource scope
1113            * @param actionId the action's ID
1114            * @throws SystemException if a system exception occurred
1115            */
1116            public void unsetRolePermissions(long roleId, long companyId,
1117                    java.lang.String name, int scope, java.lang.String actionId)
1118                    throws com.liferay.portal.kernel.exception.SystemException;
1119    
1120            /**
1121            * Removes the user's permissions to perform the actions on the resource.
1122            *
1123            * @param userId the primary key of the user
1124            * @param actionIds the primary keys of the actions
1125            * @param resourceId the primary key of the resource
1126            * @throws SystemException if a system exception occurred
1127            */
1128            public void unsetUserPermissions(long userId, java.lang.String[] actionIds,
1129                    long resourceId)
1130                    throws com.liferay.portal.kernel.exception.SystemException;
1131    }