001    /**
002     * Copyright (c) 2000-2012 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 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            * Returns the Spring bean ID for this bean.
230            *
231            * @return the Spring bean ID for this bean
232            */
233            public java.lang.String getBeanIdentifier();
234    
235            /**
236            * Sets the Spring bean ID for this bean.
237            *
238            * @param beanIdentifier the Spring bean ID for this bean
239            */
240            public void setBeanIdentifier(java.lang.String beanIdentifier);
241    
242            /**
243            * Adds a permission to perform the action on the resource.
244            *
245            * <p>
246            * This method will retrieve the permission of the company, action, and
247            * resource with the primary keys. The method creates the permission if it
248            * fails to retrieve it.
249            * </p>
250            *
251            * @param companyId the primary key of the company
252            * @param actionId the action's ID
253            * @param resourceId the primary key of the resource
254            * @return the permission of the company, action, and resource with the
255            primary keys
256            * @throws SystemException if a system exception occurred
257            */
258            public com.liferay.portal.model.Permission addPermission(long companyId,
259                    java.lang.String actionId, long resourceId)
260                    throws com.liferay.portal.kernel.exception.SystemException;
261    
262            /**
263            * Adds permissions to perform the actions on the resource.
264            *
265            * <p>
266            * This method will retrieve the permissions of the company, actions, and
267            * resource with the primary keys. The method creates any permissions it
268            * fails to retrieve.
269            * </p>
270            *
271            * @param companyId the primary key of the company
272            * @param actionIds the primary keys of the actions
273            * @param resourceId the primary key of the resource
274            * @return the permissions to perform the actions on the resource
275            * @throws SystemException if a system exception occurred
276            */
277            public java.util.List<com.liferay.portal.model.Permission> addPermissions(
278                    long companyId, java.util.List<java.lang.String> actionIds,
279                    long resourceId)
280                    throws com.liferay.portal.kernel.exception.SystemException;
281    
282            /**
283            * Adds permissions to perform either the portlet resource actions or model
284            * resource actions on the resource.
285            *
286            * <p>
287            * This method will retrieve the permissions of the company, actions, and
288            * resource with the primary keys. The method creates any permissions it
289            * fails to retrieve.
290            * </p>
291            *
292            * @param companyId the primary key of the company
293            * @param name the resource name
294            * @param resourceId the primary key of the resource
295            * @param portletActions whether to retrieve the action primary keys from
296            the portlet or the model resource
297            * @return the permissions to perform the actions on the resource
298            * @throws SystemException if a system exception occurred
299            */
300            public java.util.List<com.liferay.portal.model.Permission> addPermissions(
301                    long companyId, java.lang.String name, long resourceId,
302                    boolean portletActions)
303                    throws com.liferay.portal.kernel.exception.SystemException;
304    
305            /**
306            * Adds user permissions to perform the actions on the resource.
307            *
308            * @param userId the primary key of the user
309            * @param actionIds the primary keys of the actions
310            * @param resourceId the primary key of the resource
311            * @throws PortalException if a user with the primary key could not be found
312            * @throws SystemException if a system exception occurred
313            */
314            public void addUserPermissions(long userId, java.lang.String[] actionIds,
315                    long resourceId)
316                    throws com.liferay.portal.kernel.exception.PortalException,
317                            com.liferay.portal.kernel.exception.SystemException;
318    
319            /**
320            * Checks to see if the actions are permitted on the named resource.
321            *
322            * @param name the resource name
323            * @param actionIds the primary keys of the actions
324            * @throws PortalException if the resource company or name could not be
325            found or were invalid
326            * @throws SystemException if a system exception occurred
327            */
328            public void checkPermissions(java.lang.String name,
329                    java.util.List<java.lang.String> actionIds)
330                    throws com.liferay.portal.kernel.exception.PortalException,
331                            com.liferay.portal.kernel.exception.SystemException;
332    
333            /**
334            * Returns the IDs of all the actions belonging to the permissions.
335            *
336            * @param permissions the permissions
337            * @return the IDs of all the actions belonging to the permissions
338            */
339            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
340            public java.util.List<java.lang.String> getActions(
341                    java.util.List<com.liferay.portal.model.Permission> permissions);
342    
343            /**
344            * Returns all the group's permissions on the resource.
345            *
346            * @param groupId the primary key of the group
347            * @param resourceId the primary key of the resource
348            * @return the group's permissions on the resource
349            * @throws SystemException if a system exception occurred
350            */
351            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
352            public java.util.List<com.liferay.portal.model.Permission> getGroupPermissions(
353                    long groupId, long resourceId)
354                    throws com.liferay.portal.kernel.exception.SystemException;
355    
356            /**
357            * Returns all the group's permissions on the named resource with the scope
358            * and primKey.
359            *
360            * @param groupId the primary key of the group
361            * @param companyId the primary key of the company
362            * @param name the resource name
363            * @param scope the resource scope
364            * @param primKey the resource primKey
365            * @return the group's permissions on the named resource with the scope and
366            primKey
367            * @throws SystemException if a system exception occurred
368            */
369            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
370            public java.util.List<com.liferay.portal.model.Permission> getGroupPermissions(
371                    long groupId, long companyId, java.lang.String name, int scope,
372                    java.lang.String primKey)
373                    throws com.liferay.portal.kernel.exception.SystemException;
374    
375            /**
376            * Returns the primary key of the latest permission created.
377            *
378            * @return the primary key of the latest permission created
379            * @throws SystemException if a system exception occurred
380            */
381            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
382            public long getLatestPermissionId()
383                    throws com.liferay.portal.kernel.exception.SystemException;
384    
385            /**
386            * Returns all the permissions of the organization's group with respect to
387            * the resource.
388            *
389            * @param organizationId the primary key of the organization
390            * @param groupId the primary key of the group
391            * @param resourceId the primary key of the resource
392            * @return the permissions of the organization's group with respect to the
393            resource
394            * @throws SystemException if a system exception occurred
395            */
396            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
397            public java.util.List<com.liferay.portal.model.Permission> getOrgGroupPermissions(
398                    long organizationId, long groupId, long resourceId)
399                    throws com.liferay.portal.kernel.exception.SystemException;
400    
401            /**
402            * Returns all the permissions to perform the actions on the resource,
403            * creating new permissions for any permissions not found.
404            *
405            * @param companyId the primary key of the company
406            * @param actionIds the primary keys of the actions
407            * @param resourceId the primary key of the resource
408            * @return the permissions to perform the actions on the resource
409            * @throws SystemException if a system exception occurred
410            * @see #addPermission(long, String, long)
411            */
412            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
413            public java.util.List<com.liferay.portal.model.Permission> getPermissions(
414                    long companyId, java.lang.String[] actionIds, long resourceId)
415                    throws com.liferay.portal.kernel.exception.SystemException;
416    
417            /**
418            * Returns all the role's permissions.
419            *
420            * @param roleId the primary key of the role
421            * @return the role's permissions
422            * @throws SystemException if a system exception occurred
423            */
424            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
425            public java.util.List<com.liferay.portal.model.Permission> getRolePermissions(
426                    long roleId) throws com.liferay.portal.kernel.exception.SystemException;
427    
428            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
429            public java.util.List<com.liferay.portal.model.Permission> getRolePermissions(
430                    long roleId, int[] scopes)
431                    throws com.liferay.portal.kernel.exception.SystemException;
432    
433            /**
434            * Returns all the role's permissions on the resource.
435            *
436            * @param roleId the primary key of the role
437            * @param resourceId the primary key of the resource
438            * @return the role's permissions on the resource
439            * @throws SystemException if a system exception occurred
440            */
441            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
442            public java.util.List<com.liferay.portal.model.Permission> getRolePermissions(
443                    long roleId, long resourceId)
444                    throws com.liferay.portal.kernel.exception.SystemException;
445    
446            /**
447            * Returns all the user's permissions.
448            *
449            * @param userId the primary key of the user
450            * @return the user's permissions
451            * @throws SystemException if a system exception occurred
452            */
453            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
454            public java.util.List<com.liferay.portal.model.Permission> getUserPermissions(
455                    long userId) throws com.liferay.portal.kernel.exception.SystemException;
456    
457            /**
458            * Returns all the user's permissions on the resource.
459            *
460            * @param userId the primary key of the user
461            * @param resourceId the primary key of the resource
462            * @return the user's permissions on the resource
463            * @throws SystemException if a system exception occurred
464            */
465            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
466            public java.util.List<com.liferay.portal.model.Permission> getUserPermissions(
467                    long userId, long resourceId)
468                    throws com.liferay.portal.kernel.exception.SystemException;
469    
470            /**
471            * Returns all the user's permissions on the named resource with the scope
472            * and primKey.
473            *
474            * @param userId the primary key of the user
475            * @param companyId the primary key of the company
476            * @param name the resource name
477            * @param scope the resource scope
478            * @param primKey the resource primKey
479            * @return the user permissions of the resource name, scope, and primKey
480            * @throws SystemException if a system exception occurred
481            */
482            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
483            public java.util.List<com.liferay.portal.model.Permission> getUserPermissions(
484                    long userId, long companyId, java.lang.String name, int scope,
485                    java.lang.String primKey)
486                    throws com.liferay.portal.kernel.exception.SystemException;
487    
488            /**
489            * Returns <code>true</code> if the group has permission to perform the
490            * action on the resource.
491            *
492            * @param groupId the primary key of the group
493            * @param actionId the action's ID
494            * @param resourceId the primary key of the resource
495            * @return <code>true</code> if the group has permission to perform the
496            action on the resource; <code>false</code> otherwise
497            * @throws SystemException if a system exception occurred
498            */
499            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
500            public boolean hasGroupPermission(long groupId, java.lang.String actionId,
501                    long resourceId)
502                    throws com.liferay.portal.kernel.exception.SystemException;
503    
504            /**
505            * Returns <code>true</code> if the role has permission to perform the
506            * action on the named resource with the scope.
507            *
508            * @param roleId the primary key of the role
509            * @param companyId the primary key of the company
510            * @param name the resource name
511            * @param scope the resource scope
512            * @param actionId the action's ID
513            * @return <code>true</code> if the role has permission to perform the
514            action on the named resource with the scope; <code>false</code>
515            otherwise
516            * @throws SystemException if a system exception occurred
517            */
518            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
519            public boolean hasRolePermission(long roleId, long companyId,
520                    java.lang.String name, int scope, java.lang.String actionId)
521                    throws com.liferay.portal.kernel.exception.SystemException;
522    
523            /**
524            * Returns <code>true</code> if the role has permission to perform the
525            * action on the named resource with the scope and primKey.
526            *
527            * @param roleId the primary key of the role
528            * @param companyId the primary key of the company
529            * @param name the resource name
530            * @param scope the resource scope
531            * @param primKey the resource primKey
532            * @param actionId the action's ID
533            * @return <code>true</code> if the role has permission to perform the
534            action on the named resource with the scope and primKey;
535            <code>false</code> otherwise
536            * @throws SystemException if a system exception occurred
537            */
538            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
539            public boolean hasRolePermission(long roleId, long companyId,
540                    java.lang.String name, int scope, java.lang.String primKey,
541                    java.lang.String actionId)
542                    throws com.liferay.portal.kernel.exception.SystemException;
543    
544            /**
545            * Returns <code>true</code> if the user has permission to perform the
546            * action on the resource.
547            *
548            * @param userId the primary key of the user
549            * @param actionId the action's ID
550            * @param resourceId the primary key of the resource
551            * @return <code>true</code> if the user has permission to perform the
552            action on the resource; <code>false</code> otherwise
553            * @throws SystemException if a system exception occurred
554            */
555            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
556            public boolean hasUserPermission(long userId, java.lang.String actionId,
557                    long resourceId)
558                    throws com.liferay.portal.kernel.exception.SystemException;
559    
560            /**
561            * Returns <code>true</code> if the user has permission to perform the
562            * action on the resources.
563            *
564            * <p>
565            * This method does not support resources managed by the resource block
566            * system.
567            * </p>
568            *
569            * @param userId the primary key of the user
570            * @param groupId the primary key of the group containing the resource
571            * @param resources representations of the resource at each scope level
572            returned by {@link
573            com.liferay.portal.security.permission.AdvancedPermissionChecker#getResources(
574            long, long, String, String, String)}
575            * @param actionId the action's ID
576            * @param permissionCheckerBag the permission checker bag
577            * @return <code>true</code> if the user has permission to perform the
578            action on the resources; <code>false</code> otherwise
579            * @throws PortalException if a resource action based on any one of the
580            resources and the action ID could not be found
581            * @throws SystemException if a system exception occurred
582            */
583            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
584            public boolean hasUserPermissions(long userId, long groupId,
585                    java.util.List<com.liferay.portal.model.Resource> resources,
586                    java.lang.String actionId,
587                    com.liferay.portal.security.permission.PermissionCheckerBag permissionCheckerBag)
588                    throws com.liferay.portal.kernel.exception.PortalException,
589                            com.liferay.portal.kernel.exception.SystemException;
590    
591            /**
592            * Sets the container wide permissions of either the role or the default
593            * user of each company to perform the actions on the named resource.
594            *
595            * @param name the resource name
596            * @param roleName the role name. Supported role names include {@link
597            com.liferay.portal.model.RoleConstants#ORGANIZATION_USER}, {@link
598            com.liferay.portal.model.RoleConstants#OWNER}, and {@link
599            com.liferay.portal.model.RoleConstants#SITE_MEMBER}.
600            * @param actionId the action's ID
601            * @throws PortalException if a matching role could not be found or if a
602            default user for the company could not be found
603            * @throws SystemException if a system exception occurred
604            */
605            public void setContainerResourcePermissions(java.lang.String name,
606                    java.lang.String roleName, java.lang.String actionId)
607                    throws com.liferay.portal.kernel.exception.PortalException,
608                            com.liferay.portal.kernel.exception.SystemException;
609    
610            /**
611            * Sets the group's permissions to perform the actions on the resource,
612            * replacing the group's existing permissions on the resource.
613            *
614            * @param groupId the primary key of the group
615            * @param actionIds the primary keys of the actions
616            * @param resourceId the primary key of the resource
617            * @throws PortalException if a group with the primary key could not be
618            found
619            * @throws SystemException if a system exception occurred
620            */
621            public void setGroupPermissions(long groupId, java.lang.String[] actionIds,
622                    long resourceId)
623                    throws com.liferay.portal.kernel.exception.PortalException,
624                            com.liferay.portal.kernel.exception.SystemException;
625    
626            /**
627            * Sets the entity's group permissions to perform the actions on the
628            * resource, replacing the entity's existing group permissions on the
629            * resource. Only {@link com.liferay.portal.model.Organization} and {@link
630            * com.liferay.portal.model.UserGroup} class entities are supported.
631            *
632            * @param className the class name of an organization or user group
633            * @param classPK the primary key of the class
634            * @param groupId the primary key of the group
635            * @param actionIds the primary keys of the actions
636            * @param resourceId the primary key of the resource
637            * @throws PortalException if an entity with the class name and primary key
638            could not be found or if the entity's associated group could not
639            be found
640            * @throws SystemException if a system exception occurred
641            */
642            public void setGroupPermissions(java.lang.String className,
643                    java.lang.String classPK, long groupId, java.lang.String[] actionIds,
644                    long resourceId)
645                    throws com.liferay.portal.kernel.exception.PortalException,
646                            com.liferay.portal.kernel.exception.SystemException;
647    
648            /**
649            * Sets the organization's group permissions to perform the actions on the
650            * resource, replacing the organization's existing group permissions on the
651            * resource.
652            *
653            * @param organizationId the primary key of the organization
654            * @param groupId the primary key of the group in which to scope the
655            permissions
656            * @param actionIds the primary keys of the actions
657            * @param resourceId the primary key of the resource
658            * @throws PortalException if an organization with the primary key could not
659            be found
660            * @throws SystemException if a system exception occurred
661            */
662            public void setOrgGroupPermissions(long organizationId, long groupId,
663                    java.lang.String[] actionIds, long resourceId)
664                    throws com.liferay.portal.kernel.exception.PortalException,
665                            com.liferay.portal.kernel.exception.SystemException;
666    
667            /**
668            * Sets the role's permissions to perform the action on the named resource,
669            * replacing the role's existing permissions on the resource.
670            *
671            * @param roleId the primary key of the role
672            * @param companyId the primary key of the company
673            * @param name the resource name
674            * @param scope the resource scope
675            * @param primKey the resource primKey
676            * @param actionId the action's ID
677            * @throws PortalException if the scope was {@link
678            com.liferay.portal.model.ResourceConstants#SCOPE_INDIVIDUAL}
679            * @throws SystemException if a system exception occurred
680            */
681            public void setRolePermission(long roleId, long companyId,
682                    java.lang.String name, int scope, java.lang.String primKey,
683                    java.lang.String actionId)
684                    throws com.liferay.portal.kernel.exception.PortalException,
685                            com.liferay.portal.kernel.exception.SystemException;
686    
687            /**
688            * Sets the role's permissions to perform the actions on the named resource,
689            * replacing the role's existing permission for each of these actions on the
690            * resource.
691            *
692            * @param roleId the primary key of the role
693            * @param companyId the primary key of the company
694            * @param name the resource name
695            * @param scope the resource scope
696            * @param primKey the resource primKey
697            * @param actionIds the primary keys of the actions
698            * @throws PortalException if the scope was {@link
699            com.liferay.portal.model.ResourceConstants#SCOPE_INDIVIDUAL}
700            * @throws SystemException if a system exception occurred
701            */
702            public void setRolePermissions(long roleId, long companyId,
703                    java.lang.String name, int scope, java.lang.String primKey,
704                    java.lang.String[] actionIds)
705                    throws com.liferay.portal.kernel.exception.PortalException,
706                            com.liferay.portal.kernel.exception.SystemException;
707    
708            /**
709            * Sets the role's permissions to perform the actions on the resource,
710            * replacing the role's existing permissions on the resource.
711            *
712            * @param roleId the primary key of the role
713            * @param actionIds the primary keys of the actions
714            * @param resourceId the primary key of the resource
715            * @throws PortalException if a role with the primary key could not be found
716            * @throws SystemException if a system exception occurred
717            */
718            public void setRolePermissions(long roleId, java.lang.String[] actionIds,
719                    long resourceId)
720                    throws com.liferay.portal.kernel.exception.PortalException,
721                            com.liferay.portal.kernel.exception.SystemException;
722    
723            /**
724            * Sets the permissions of each role to perform respective actions on the
725            * resource, replacing the existing permissions of each role on the
726            * resource.
727            *
728            * @param companyId the primary key of the company
729            * @param roleIdsToActionIds the map of roles to their new actions on the
730            resource
731            * @param resourceId the primary key of the resource
732            * @throws SystemException if a system exception occurred
733            */
734            public void setRolesPermissions(long companyId,
735                    java.util.Map<java.lang.Long, java.lang.String[]> roleIdsToActionIds,
736                    long resourceId)
737                    throws com.liferay.portal.kernel.exception.SystemException;
738    
739            /**
740            * Sets the permissions of each role to perform respective actions on the
741            * named resource, replacing the existing permissions of each role on the
742            * resource.
743            *
744            * @param companyId the primary key of the company
745            * @param roleIdsToActionIds the map of roles to their new actions on the
746            resource
747            * @param name the resource name
748            * @param scope the resource scope
749            * @param primKey the resource primKey
750            * @throws SystemException if a system exception occurred
751            */
752            public void setRolesPermissions(long companyId,
753                    java.util.Map<java.lang.Long, java.lang.String[]> roleIdsToActionIds,
754                    java.lang.String name, int scope, java.lang.String primKey)
755                    throws com.liferay.portal.kernel.exception.SystemException;
756    
757            /**
758            * Sets the user's permissions to perform the actions on the resource,
759            * replacing the user's existing permissions on the resource.
760            *
761            * @param userId the primary key of the user
762            * @param actionIds the primary keys of the actions
763            * @param resourceId the primary key of the resource
764            * @throws PortalException if a user with the primary key could not be found
765            * @throws SystemException if a system exception occurred
766            */
767            public void setUserPermissions(long userId, java.lang.String[] actionIds,
768                    long resourceId)
769                    throws com.liferay.portal.kernel.exception.PortalException,
770                            com.liferay.portal.kernel.exception.SystemException;
771    
772            /**
773            * Removes the permission from the role.
774            *
775            * @param roleId the primary key of the role
776            * @param permissionId the primary key of the permission
777            * @throws SystemException if a system exception occurred
778            */
779            public void unsetRolePermission(long roleId, long permissionId)
780                    throws com.liferay.portal.kernel.exception.SystemException;
781    
782            /**
783            * Removes the role's permissions to perform the action on the named
784            * resource with the scope and primKey.
785            *
786            * @param roleId the primary key of the role
787            * @param companyId the primary key of the company
788            * @param name the resource name
789            * @param scope the resource scope
790            * @param primKey the resource primKey
791            * @param actionId the action's ID
792            * @throws SystemException if a system exception occurred
793            */
794            public void unsetRolePermission(long roleId, long companyId,
795                    java.lang.String name, int scope, java.lang.String primKey,
796                    java.lang.String actionId)
797                    throws com.liferay.portal.kernel.exception.SystemException;
798    
799            /**
800            * Removes the role's permissions to perform the action on the named
801            * resource.
802            *
803            * @param roleId the primary key of the role
804            * @param companyId the primary key of the company
805            * @param name the resource name
806            * @param scope the resource scope
807            * @param actionId the action's ID
808            * @throws SystemException if a system exception occurred
809            */
810            public void unsetRolePermissions(long roleId, long companyId,
811                    java.lang.String name, int scope, java.lang.String actionId)
812                    throws com.liferay.portal.kernel.exception.SystemException;
813    
814            /**
815            * Removes the user's permissions to perform the actions on the resource.
816            *
817            * @param userId the primary key of the user
818            * @param actionIds the primary keys of the actions
819            * @param resourceId the primary key of the resource
820            * @throws SystemException if a system exception occurred
821            */
822            public void unsetUserPermissions(long userId, java.lang.String[] actionIds,
823                    long resourceId)
824                    throws com.liferay.portal.kernel.exception.SystemException;
825    }