001    /**
002     * Copyright (c) 2000-2012 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 PersistedModelLocalService {
039            /*
040             * NOTE FOR DEVELOPERS:
041             *
042             * Never modify or reference this interface directly. Always use {@link PermissionLocalServiceUtil} to access the permission local service. Add custom service methods to {@link com.liferay.portal.service.impl.PermissionLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
043             */
044    
045            /**
046            * Adds the permission to the database. Also notifies the appropriate model listeners.
047            *
048            * @param permission the permission
049            * @return the permission that was added
050            * @throws SystemException if a system exception occurred
051            */
052            public com.liferay.portal.model.Permission addPermission(
053                    com.liferay.portal.model.Permission permission)
054                    throws com.liferay.portal.kernel.exception.SystemException;
055    
056            /**
057            * Creates a new permission with the primary key. Does not add the permission to the database.
058            *
059            * @param permissionId the primary key for the new permission
060            * @return the new permission
061            */
062            public com.liferay.portal.model.Permission createPermission(
063                    long permissionId);
064    
065            /**
066            * Deletes the permission with the primary key from the database. Also notifies the appropriate model listeners.
067            *
068            * @param permissionId the primary key of the permission
069            * @throws PortalException if a permission with the primary key could not be found
070            * @throws SystemException if a system exception occurred
071            */
072            public void deletePermission(long permissionId)
073                    throws com.liferay.portal.kernel.exception.PortalException,
074                            com.liferay.portal.kernel.exception.SystemException;
075    
076            /**
077            * Deletes the permission from the database. Also notifies the appropriate model listeners.
078            *
079            * @param permission the permission
080            * @throws SystemException if a system exception occurred
081            */
082            public void deletePermission(com.liferay.portal.model.Permission permission)
083                    throws com.liferay.portal.kernel.exception.SystemException;
084    
085            /**
086            * Performs a dynamic query on the database and returns the matching rows.
087            *
088            * @param dynamicQuery the dynamic query
089            * @return the matching rows
090            * @throws SystemException if a system exception occurred
091            */
092            @SuppressWarnings("rawtypes")
093            public java.util.List dynamicQuery(
094                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
095                    throws com.liferay.portal.kernel.exception.SystemException;
096    
097            /**
098            * Performs a dynamic query on the database and returns a range of the matching rows.
099            *
100            * <p>
101            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
102            * </p>
103            *
104            * @param dynamicQuery the dynamic query
105            * @param start the lower bound of the range of model instances
106            * @param end the upper bound of the range of model instances (not inclusive)
107            * @return the range of matching rows
108            * @throws SystemException if a system exception occurred
109            */
110            @SuppressWarnings("rawtypes")
111            public java.util.List dynamicQuery(
112                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
113                    int end) throws com.liferay.portal.kernel.exception.SystemException;
114    
115            /**
116            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
117            *
118            * <p>
119            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
120            * </p>
121            *
122            * @param dynamicQuery the dynamic query
123            * @param start the lower bound of the range of model instances
124            * @param end the upper bound of the range of model instances (not inclusive)
125            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
126            * @return the ordered range of matching rows
127            * @throws SystemException if a system exception occurred
128            */
129            @SuppressWarnings("rawtypes")
130            public java.util.List dynamicQuery(
131                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
132                    int end,
133                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
134                    throws com.liferay.portal.kernel.exception.SystemException;
135    
136            /**
137            * Returns the number of rows that match the dynamic query.
138            *
139            * @param dynamicQuery the dynamic query
140            * @return the number of rows that match the dynamic query
141            * @throws SystemException if a system exception occurred
142            */
143            public long dynamicQueryCount(
144                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
145                    throws com.liferay.portal.kernel.exception.SystemException;
146    
147            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
148            public com.liferay.portal.model.Permission fetchPermission(
149                    long permissionId)
150                    throws com.liferay.portal.kernel.exception.SystemException;
151    
152            /**
153            * Returns the permission with the primary key.
154            *
155            * @param permissionId the primary key of the permission
156            * @return the permission
157            * @throws PortalException if a permission with the primary key could not be found
158            * @throws SystemException if a system exception occurred
159            */
160            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
161            public com.liferay.portal.model.Permission getPermission(long permissionId)
162                    throws com.liferay.portal.kernel.exception.PortalException,
163                            com.liferay.portal.kernel.exception.SystemException;
164    
165            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
166            public com.liferay.portal.model.PersistedModel getPersistedModel(
167                    java.io.Serializable primaryKeyObj)
168                    throws com.liferay.portal.kernel.exception.PortalException,
169                            com.liferay.portal.kernel.exception.SystemException;
170    
171            /**
172            * Returns a range of all the permissions.
173            *
174            * <p>
175            * 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.
176            * </p>
177            *
178            * @param start the lower bound of the range of permissions
179            * @param end the upper bound of the range of permissions (not inclusive)
180            * @return the range of permissions
181            * @throws SystemException if a system exception occurred
182            */
183            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
184            public java.util.List<com.liferay.portal.model.Permission> getPermissions(
185                    int start, int end)
186                    throws com.liferay.portal.kernel.exception.SystemException;
187    
188            /**
189            * Returns the number of permissions.
190            *
191            * @return the number of permissions
192            * @throws SystemException if a system exception occurred
193            */
194            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
195            public int getPermissionsCount()
196                    throws com.liferay.portal.kernel.exception.SystemException;
197    
198            /**
199            * Updates the permission in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
200            *
201            * @param permission the permission
202            * @return the permission that was updated
203            * @throws SystemException if a system exception occurred
204            */
205            public com.liferay.portal.model.Permission updatePermission(
206                    com.liferay.portal.model.Permission permission)
207                    throws com.liferay.portal.kernel.exception.SystemException;
208    
209            /**
210            * Updates the permission in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
211            *
212            * @param permission the permission
213            * @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.
214            * @return the permission that was updated
215            * @throws SystemException if a system exception occurred
216            */
217            public com.liferay.portal.model.Permission updatePermission(
218                    com.liferay.portal.model.Permission permission, boolean merge)
219                    throws com.liferay.portal.kernel.exception.SystemException;
220    
221            /**
222            * Returns the Spring bean ID for this bean.
223            *
224            * @return the Spring bean ID for this bean
225            */
226            public java.lang.String getBeanIdentifier();
227    
228            /**
229            * Sets the Spring bean ID for this bean.
230            *
231            * @param beanIdentifier the Spring bean ID for this bean
232            */
233            public void setBeanIdentifier(java.lang.String beanIdentifier);
234    
235            /**
236            * Adds a permission to perform the action on the resource.
237            *
238            * <p>
239            * This method will retrieve the permission of the company, action, and
240            * resource with the primary keys. The method creates the permission if it
241            * fails to retrieve it.
242            * </p>
243            *
244            * @param companyId the primary key of the company
245            * @param actionId the action's ID
246            * @param resourceId the primary key of the resource
247            * @return the permission of the company, action, and resource with the
248            primary keys
249            * @throws SystemException if a system exception occurred
250            */
251            public com.liferay.portal.model.Permission addPermission(long companyId,
252                    java.lang.String actionId, long resourceId)
253                    throws com.liferay.portal.kernel.exception.SystemException;
254    
255            /**
256            * Adds permissions to perform the actions on the resource.
257            *
258            * <p>
259            * This method will retrieve the permissions of the company, actions, and
260            * resource with the primary keys. The method creates any permissions it
261            * fails to retrieve.
262            * </p>
263            *
264            * @param companyId the primary key of the company
265            * @param actionIds the primary keys of the actions
266            * @param resourceId the primary key of the resource
267            * @return the permissions to perform the actions on the resource
268            * @throws SystemException if a system exception occurred
269            */
270            public java.util.List<com.liferay.portal.model.Permission> addPermissions(
271                    long companyId, java.util.List<java.lang.String> actionIds,
272                    long resourceId)
273                    throws com.liferay.portal.kernel.exception.SystemException;
274    
275            /**
276            * Adds permissions to perform either the portlet resource actions or model
277            * resource actions on the resource.
278            *
279            * <p>
280            * This method will retrieve the permissions of the company, actions, and
281            * resource with the primary keys. The method creates any permissions it
282            * fails to retrieve.
283            * </p>
284            *
285            * @param companyId the primary key of the company
286            * @param name the resource name
287            * @param resourceId the primary key of the resource
288            * @param portletActions whether to retrieve the action primary keys from
289            the portlet or the model resource
290            * @return the permissions to perform the actions on the resource
291            * @throws SystemException if a system exception occurred
292            */
293            public java.util.List<com.liferay.portal.model.Permission> addPermissions(
294                    long companyId, java.lang.String name, long resourceId,
295                    boolean portletActions)
296                    throws com.liferay.portal.kernel.exception.SystemException;
297    
298            /**
299            * Adds user permissions to perform the actions on the resource.
300            *
301            * @param userId the primary key of the user
302            * @param actionIds the primary keys of the actions
303            * @param resourceId the primary key of the resource
304            * @throws PortalException if a user with the primary key could not be found
305            * @throws SystemException if a system exception occurred
306            */
307            public void addUserPermissions(long userId, java.lang.String[] actionIds,
308                    long resourceId)
309                    throws com.liferay.portal.kernel.exception.PortalException,
310                            com.liferay.portal.kernel.exception.SystemException;
311    
312            /**
313            * Checks to see if the actions are permitted on the named resource.
314            *
315            * @param name the resource name
316            * @param actionIds the primary keys of the actions
317            * @throws PortalException if the resource company or name could not be
318            found or were invalid
319            * @throws SystemException if a system exception occurred
320            */
321            public void checkPermissions(java.lang.String name,
322                    java.util.List<java.lang.String> actionIds)
323                    throws com.liferay.portal.kernel.exception.PortalException,
324                            com.liferay.portal.kernel.exception.SystemException;
325    
326            /**
327            * Returns the IDs of all the actions belonging to the permissions.
328            *
329            * @param permissions the permissions
330            * @return the IDs of all the actions belonging to the permissions
331            */
332            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
333            public java.util.List<java.lang.String> getActions(
334                    java.util.List<com.liferay.portal.model.Permission> permissions);
335    
336            /**
337            * Returns all the group's permissions on the resource.
338            *
339            * @param groupId the primary key of the group
340            * @param resourceId the primary key of the resource
341            * @return the group's permissions on the resource
342            * @throws SystemException if a system exception occurred
343            */
344            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
345            public java.util.List<com.liferay.portal.model.Permission> getGroupPermissions(
346                    long groupId, long resourceId)
347                    throws com.liferay.portal.kernel.exception.SystemException;
348    
349            /**
350            * Returns all the group's permissions on the named resource with the scope
351            * and primKey.
352            *
353            * @param groupId the primary key of the group
354            * @param companyId the primary key of the company
355            * @param name the resource name
356            * @param scope the resource scope
357            * @param primKey the resource primKey
358            * @return the group's permissions on the named resource with the scope and
359            primKey
360            * @throws SystemException if a system exception occurred
361            */
362            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
363            public java.util.List<com.liferay.portal.model.Permission> getGroupPermissions(
364                    long groupId, long companyId, java.lang.String name, int scope,
365                    java.lang.String primKey)
366                    throws com.liferay.portal.kernel.exception.SystemException;
367    
368            /**
369            * Returns the primary key of the latest permission created.
370            *
371            * @return the primary key of the latest permission created
372            * @throws SystemException if a system exception occurred
373            */
374            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
375            public long getLatestPermissionId()
376                    throws com.liferay.portal.kernel.exception.SystemException;
377    
378            /**
379            * Returns all the permissions of the organization's group with respect to
380            * the resource.
381            *
382            * @param organizationId the primary key of the organization
383            * @param groupId the primary key of the group
384            * @param resourceId the primary key of the resource
385            * @return the permissions of the organization's group with respect to the
386            resource
387            * @throws SystemException if a system exception occurred
388            */
389            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
390            public java.util.List<com.liferay.portal.model.Permission> getOrgGroupPermissions(
391                    long organizationId, long groupId, long resourceId)
392                    throws com.liferay.portal.kernel.exception.SystemException;
393    
394            /**
395            * Returns all the permissions to perform the actions on the resource,
396            * creating new permissions for any permissions not found.
397            *
398            * @param companyId the primary key of the company
399            * @param actionIds the primary keys of the actions
400            * @param resourceId the primary key of the resource
401            * @return the permissions to perform the actions on the resource
402            * @throws SystemException if a system exception occurred
403            * @see #addPermission(long, String, long)
404            */
405            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
406            public java.util.List<com.liferay.portal.model.Permission> getPermissions(
407                    long companyId, java.lang.String[] actionIds, long resourceId)
408                    throws com.liferay.portal.kernel.exception.SystemException;
409    
410            /**
411            * Returns all the role's permissions.
412            *
413            * @param roleId the primary key of the role
414            * @return the role's permissions
415            * @throws SystemException if a system exception occurred
416            */
417            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
418            public java.util.List<com.liferay.portal.model.Permission> getRolePermissions(
419                    long roleId) throws com.liferay.portal.kernel.exception.SystemException;
420    
421            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
422            public java.util.List<com.liferay.portal.model.Permission> getRolePermissions(
423                    long roleId, int[] scopes)
424                    throws com.liferay.portal.kernel.exception.SystemException;
425    
426            /**
427            * Returns all the role's permissions on the resource.
428            *
429            * @param roleId the primary key of the role
430            * @param resourceId the primary key of the resource
431            * @return the role's permissions on the resource
432            * @throws SystemException if a system exception occurred
433            */
434            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
435            public java.util.List<com.liferay.portal.model.Permission> getRolePermissions(
436                    long roleId, long resourceId)
437                    throws com.liferay.portal.kernel.exception.SystemException;
438    
439            /**
440            * Returns all the user's permissions.
441            *
442            * @param userId the primary key of the user
443            * @return the user's permissions
444            * @throws SystemException if a system exception occurred
445            */
446            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
447            public java.util.List<com.liferay.portal.model.Permission> getUserPermissions(
448                    long userId) throws com.liferay.portal.kernel.exception.SystemException;
449    
450            /**
451            * Returns all the user's permissions on the resource.
452            *
453            * @param userId the primary key of the user
454            * @param resourceId the primary key of the resource
455            * @return the user's permissions on the resource
456            * @throws SystemException if a system exception occurred
457            */
458            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
459            public java.util.List<com.liferay.portal.model.Permission> getUserPermissions(
460                    long userId, long resourceId)
461                    throws com.liferay.portal.kernel.exception.SystemException;
462    
463            /**
464            * Returns all the user's permissions on the named resource with the scope
465            * and primKey.
466            *
467            * @param userId the primary key of the user
468            * @param companyId the primary key of the company
469            * @param name the resource name
470            * @param scope the resource scope
471            * @param primKey the resource primKey
472            * @return the user permissions of the resource name, scope, and primKey
473            * @throws SystemException if a system exception occurred
474            */
475            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
476            public java.util.List<com.liferay.portal.model.Permission> getUserPermissions(
477                    long userId, long companyId, java.lang.String name, int scope,
478                    java.lang.String primKey)
479                    throws com.liferay.portal.kernel.exception.SystemException;
480    
481            /**
482            * Returns <code>true</code> if the group has permission to perform the
483            * action on the resource.
484            *
485            * @param groupId the primary key of the group
486            * @param actionId the action's ID
487            * @param resourceId the primary key of the resource
488            * @return <code>true</code> if the group has permission to perform the
489            action on the resource; <code>false</code> otherwise
490            * @throws SystemException if a system exception occurred
491            */
492            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
493            public boolean hasGroupPermission(long groupId, java.lang.String actionId,
494                    long resourceId)
495                    throws com.liferay.portal.kernel.exception.SystemException;
496    
497            /**
498            * Returns <code>true</code> if the role has permission to perform the
499            * action on the named resource with the scope.
500            *
501            * @param roleId the primary key of the role
502            * @param companyId the primary key of the company
503            * @param name the resource name
504            * @param scope the resource scope
505            * @param actionId the action's ID
506            * @return <code>true</code> if the role has permission to perform the
507            action on the named resource with the scope; <code>false</code>
508            otherwise
509            * @throws SystemException if a system exception occurred
510            */
511            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
512            public boolean hasRolePermission(long roleId, long companyId,
513                    java.lang.String name, int scope, java.lang.String actionId)
514                    throws com.liferay.portal.kernel.exception.SystemException;
515    
516            /**
517            * Returns <code>true</code> if the role has permission to perform the
518            * action on the named resource with the scope and primKey.
519            *
520            * @param roleId the primary key of the role
521            * @param companyId the primary key of the company
522            * @param name the resource name
523            * @param scope the resource scope
524            * @param primKey the resource primKey
525            * @param actionId the action's ID
526            * @return <code>true</code> if the role has permission to perform the
527            action on the named resource with the scope and primKey;
528            <code>false</code> otherwise
529            * @throws SystemException if a system exception occurred
530            */
531            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
532            public boolean hasRolePermission(long roleId, long companyId,
533                    java.lang.String name, int scope, java.lang.String primKey,
534                    java.lang.String actionId)
535                    throws com.liferay.portal.kernel.exception.SystemException;
536    
537            /**
538            * Returns <code>true</code> if the user has permission to perform the
539            * action on the resource.
540            *
541            * @param userId the primary key of the user
542            * @param actionId the action's ID
543            * @param resourceId the primary key of the resource
544            * @return <code>true</code> if the user has permission to perform the
545            action on the resource; <code>false</code> otherwise
546            * @throws SystemException if a system exception occurred
547            */
548            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
549            public boolean hasUserPermission(long userId, java.lang.String actionId,
550                    long resourceId)
551                    throws com.liferay.portal.kernel.exception.SystemException;
552    
553            /**
554            * Returns <code>true</code> if the user has permission to perform the
555            * action on the resources.
556            *
557            * <p>
558            * This method does not support resources managed by the resource block
559            * system.
560            * </p>
561            *
562            * @param userId the primary key of the user
563            * @param groupId the primary key of the group containing the resource
564            * @param resources representations of the resource at each scope level
565            returned by {@link
566            com.liferay.portal.security.permission.AdvancedPermissionChecker#getResources(
567            long, long, String, String, String)}
568            * @param actionId the action's ID
569            * @param permissionCheckerBag the permission checker bag
570            * @return <code>true</code> if the user has permission to perform the
571            action on the resources; <code>false</code> otherwise
572            * @throws PortalException if a resource action based on any one of the
573            resources and the action ID could not be found
574            * @throws SystemException if a system exception occurred
575            */
576            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
577            public boolean hasUserPermissions(long userId, long groupId,
578                    java.util.List<com.liferay.portal.model.Resource> resources,
579                    java.lang.String actionId,
580                    com.liferay.portal.security.permission.PermissionCheckerBag permissionCheckerBag)
581                    throws com.liferay.portal.kernel.exception.PortalException,
582                            com.liferay.portal.kernel.exception.SystemException;
583    
584            /**
585            * Sets the container wide permissions of either the role or the default
586            * user of each company to perform the actions on the named resource.
587            *
588            * @param name the resource name
589            * @param roleName the role name. Supported role names include {@link
590            com.liferay.portal.model.RoleConstants#ORGANIZATION_USER}, {@link
591            com.liferay.portal.model.RoleConstants#OWNER}, and {@link
592            com.liferay.portal.model.RoleConstants#SITE_MEMBER}.
593            * @param actionId the action's ID
594            * @throws PortalException if a matching role could not be found or if a
595            default user for the company could not be found
596            * @throws SystemException if a system exception occurred
597            */
598            public void setContainerResourcePermissions(java.lang.String name,
599                    java.lang.String roleName, java.lang.String actionId)
600                    throws com.liferay.portal.kernel.exception.PortalException,
601                            com.liferay.portal.kernel.exception.SystemException;
602    
603            /**
604            * Sets the group's permissions to perform the actions on the resource,
605            * replacing the group's existing permissions on the resource.
606            *
607            * @param groupId the primary key of the group
608            * @param actionIds the primary keys of the actions
609            * @param resourceId the primary key of the resource
610            * @throws PortalException if a group with the primary key could not be
611            found
612            * @throws SystemException if a system exception occurred
613            */
614            public void setGroupPermissions(long groupId, java.lang.String[] actionIds,
615                    long resourceId)
616                    throws com.liferay.portal.kernel.exception.PortalException,
617                            com.liferay.portal.kernel.exception.SystemException;
618    
619            /**
620            * Sets the entity's group permissions to perform the actions on the
621            * resource, replacing the entity's existing group permissions on the
622            * resource. Only {@link com.liferay.portal.model.Organization} and {@link
623            * com.liferay.portal.model.UserGroup} class entities are supported.
624            *
625            * @param className the class name of an organization or user group
626            * @param classPK the primary key of the class
627            * @param groupId the primary key of the group
628            * @param actionIds the primary keys of the actions
629            * @param resourceId the primary key of the resource
630            * @throws PortalException if an entity with the class name and primary key
631            could not be found or if the entity's associated group could not
632            be found
633            * @throws SystemException if a system exception occurred
634            */
635            public void setGroupPermissions(java.lang.String className,
636                    java.lang.String classPK, long groupId, java.lang.String[] actionIds,
637                    long resourceId)
638                    throws com.liferay.portal.kernel.exception.PortalException,
639                            com.liferay.portal.kernel.exception.SystemException;
640    
641            /**
642            * Sets the organization's group permissions to perform the actions on the
643            * resource, replacing the organization's existing group permissions on the
644            * resource.
645            *
646            * @param organizationId the primary key of the organization
647            * @param groupId the primary key of the group in which to scope the
648            permissions
649            * @param actionIds the primary keys of the actions
650            * @param resourceId the primary key of the resource
651            * @throws PortalException if an organization with the primary key could not
652            be found
653            * @throws SystemException if a system exception occurred
654            */
655            public void setOrgGroupPermissions(long organizationId, long groupId,
656                    java.lang.String[] actionIds, long resourceId)
657                    throws com.liferay.portal.kernel.exception.PortalException,
658                            com.liferay.portal.kernel.exception.SystemException;
659    
660            /**
661            * Sets the role's permissions to perform the action on the named resource,
662            * replacing the role's existing permissions on the resource.
663            *
664            * @param roleId the primary key of the role
665            * @param companyId the primary key of the company
666            * @param name the resource name
667            * @param scope the resource scope
668            * @param primKey the resource primKey
669            * @param actionId the action's ID
670            * @throws PortalException if the scope was {@link
671            com.liferay.portal.model.ResourceConstants#SCOPE_INDIVIDUAL}
672            * @throws SystemException if a system exception occurred
673            */
674            public void setRolePermission(long roleId, long companyId,
675                    java.lang.String name, int scope, java.lang.String primKey,
676                    java.lang.String actionId)
677                    throws com.liferay.portal.kernel.exception.PortalException,
678                            com.liferay.portal.kernel.exception.SystemException;
679    
680            /**
681            * Sets the role's permissions to perform the actions on the named resource,
682            * replacing the role's existing permission for each of these actions on the
683            * resource.
684            *
685            * @param roleId the primary key of the role
686            * @param companyId the primary key of the company
687            * @param name the resource name
688            * @param scope the resource scope
689            * @param primKey the resource primKey
690            * @param actionIds the primary keys of the actions
691            * @throws PortalException if the scope was {@link
692            com.liferay.portal.model.ResourceConstants#SCOPE_INDIVIDUAL}
693            * @throws SystemException if a system exception occurred
694            */
695            public void setRolePermissions(long roleId, long companyId,
696                    java.lang.String name, int scope, java.lang.String primKey,
697                    java.lang.String[] actionIds)
698                    throws com.liferay.portal.kernel.exception.PortalException,
699                            com.liferay.portal.kernel.exception.SystemException;
700    
701            /**
702            * Sets the role's permissions to perform the actions on the resource,
703            * replacing the role's existing permissions on the resource.
704            *
705            * @param roleId the primary key of the role
706            * @param actionIds the primary keys of the actions
707            * @param resourceId the primary key of the resource
708            * @throws PortalException if a role with the primary key could not be found
709            * @throws SystemException if a system exception occurred
710            */
711            public void setRolePermissions(long roleId, java.lang.String[] actionIds,
712                    long resourceId)
713                    throws com.liferay.portal.kernel.exception.PortalException,
714                            com.liferay.portal.kernel.exception.SystemException;
715    
716            /**
717            * Sets the permissions of each role to perform respective actions on the
718            * resource, replacing the existing permissions of each role on the
719            * resource.
720            *
721            * @param companyId the primary key of the company
722            * @param roleIdsToActionIds the map of roles to their new actions on the
723            resource
724            * @param resourceId the primary key of the resource
725            * @throws SystemException if a system exception occurred
726            */
727            public void setRolesPermissions(long companyId,
728                    java.util.Map<java.lang.Long, java.lang.String[]> roleIdsToActionIds,
729                    long resourceId)
730                    throws com.liferay.portal.kernel.exception.SystemException;
731    
732            /**
733            * Sets the permissions of each role to perform respective actions on the
734            * named resource, replacing the existing permissions of each role on the
735            * resource.
736            *
737            * @param companyId the primary key of the company
738            * @param roleIdsToActionIds the map of roles to their new actions on the
739            resource
740            * @param name the resource name
741            * @param scope the resource scope
742            * @param primKey the resource primKey
743            * @throws SystemException if a system exception occurred
744            */
745            public void setRolesPermissions(long companyId,
746                    java.util.Map<java.lang.Long, java.lang.String[]> roleIdsToActionIds,
747                    java.lang.String name, int scope, java.lang.String primKey)
748                    throws com.liferay.portal.kernel.exception.SystemException;
749    
750            /**
751            * Sets the user's permissions to perform the actions on the resource,
752            * replacing the user's existing permissions on the resource.
753            *
754            * @param userId the primary key of the user
755            * @param actionIds the primary keys of the actions
756            * @param resourceId the primary key of the resource
757            * @throws PortalException if a user with the primary key could not be found
758            * @throws SystemException if a system exception occurred
759            */
760            public void setUserPermissions(long userId, java.lang.String[] actionIds,
761                    long resourceId)
762                    throws com.liferay.portal.kernel.exception.PortalException,
763                            com.liferay.portal.kernel.exception.SystemException;
764    
765            /**
766            * Removes the permission from the role.
767            *
768            * @param roleId the primary key of the role
769            * @param permissionId the primary key of the permission
770            * @throws SystemException if a system exception occurred
771            */
772            public void unsetRolePermission(long roleId, long permissionId)
773                    throws com.liferay.portal.kernel.exception.SystemException;
774    
775            /**
776            * Removes the role's permissions to perform the action on the named
777            * resource with the scope and primKey.
778            *
779            * @param roleId the primary key of the role
780            * @param companyId the primary key of the company
781            * @param name the resource name
782            * @param scope the resource scope
783            * @param primKey the resource primKey
784            * @param actionId the action's ID
785            * @throws SystemException if a system exception occurred
786            */
787            public void unsetRolePermission(long roleId, long companyId,
788                    java.lang.String name, int scope, java.lang.String primKey,
789                    java.lang.String actionId)
790                    throws com.liferay.portal.kernel.exception.SystemException;
791    
792            /**
793            * Removes the role's permissions to perform the action on the named
794            * resource.
795            *
796            * @param roleId the primary key of the role
797            * @param companyId the primary key of the company
798            * @param name the resource name
799            * @param scope the resource scope
800            * @param actionId the action's ID
801            * @throws SystemException if a system exception occurred
802            */
803            public void unsetRolePermissions(long roleId, long companyId,
804                    java.lang.String name, int scope, java.lang.String actionId)
805                    throws com.liferay.portal.kernel.exception.SystemException;
806    
807            /**
808            * Removes the user's permissions to perform the actions on the resource.
809            *
810            * @param userId the primary key of the user
811            * @param actionIds the primary keys of the actions
812            * @param resourceId the primary key of the resource
813            * @throws SystemException if a system exception occurred
814            */
815            public void unsetUserPermissions(long userId, java.lang.String[] actionIds,
816                    long resourceId)
817                    throws com.liferay.portal.kernel.exception.SystemException;
818    }