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