001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.service;
016    
017    import com.liferay.portal.kernel.exception.PortalException;
018    import com.liferay.portal.kernel.exception.SystemException;
019    import com.liferay.portal.kernel.transaction.Isolation;
020    import com.liferay.portal.kernel.transaction.Propagation;
021    import com.liferay.portal.kernel.transaction.Transactional;
022    
023    /**
024     * The interface for the permission local service.
025     *
026     * <p>
027     * This is a local service. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM.
028     * </p>
029     *
030     * @author Brian Wing Shun Chan
031     * @see PermissionLocalServiceUtil
032     * @see com.liferay.portal.service.base.PermissionLocalServiceBaseImpl
033     * @see com.liferay.portal.service.impl.PermissionLocalServiceImpl
034     * @generated
035     */
036    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
037            PortalException.class, SystemException.class})
038    public interface PermissionLocalService extends PersistedModelLocalService {
039            /*
040             * NOTE FOR DEVELOPERS:
041             *
042             * Never modify or reference this interface directly. Always use {@link PermissionLocalServiceUtil} to access the permission local service. Add custom service methods to {@link com.liferay.portal.service.impl.PermissionLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
043             */
044    
045            /**
046            * Adds the permission to the database. Also notifies the appropriate model listeners.
047            *
048            * @param permission the permission
049            * @return the permission that was added
050            * @throws SystemException if a system exception occurred
051            */
052            public com.liferay.portal.model.Permission addPermission(
053                    com.liferay.portal.model.Permission permission)
054                    throws com.liferay.portal.kernel.exception.SystemException;
055    
056            /**
057            * Creates a new permission with the primary key. Does not add the permission to the database.
058            *
059            * @param permissionId the primary key for the new permission
060            * @return the new permission
061            */
062            public com.liferay.portal.model.Permission createPermission(
063                    long permissionId);
064    
065            /**
066            * Deletes the permission with the primary key from the database. Also notifies the appropriate model listeners.
067            *
068            * @param permissionId the primary key of the permission
069            * @throws PortalException if a permission with the primary key could not be found
070            * @throws SystemException if a system exception occurred
071            */
072            public void deletePermission(long permissionId)
073                    throws com.liferay.portal.kernel.exception.PortalException,
074                            com.liferay.portal.kernel.exception.SystemException;
075    
076            /**
077            * Deletes the permission from the database. Also notifies the appropriate model listeners.
078            *
079            * @param permission the permission
080            * @throws SystemException if a system exception occurred
081            */
082            public void deletePermission(com.liferay.portal.model.Permission permission)
083                    throws com.liferay.portal.kernel.exception.SystemException;
084    
085            /**
086            * Performs a dynamic query on the database and returns the matching rows.
087            *
088            * @param dynamicQuery the dynamic query
089            * @return the matching rows
090            * @throws SystemException if a system exception occurred
091            */
092            @SuppressWarnings("rawtypes")
093            public java.util.List dynamicQuery(
094                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
095                    throws com.liferay.portal.kernel.exception.SystemException;
096    
097            /**
098            * Performs a dynamic query on the database and returns a range of the matching rows.
099            *
100            * <p>
101            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
102            * </p>
103            *
104            * @param dynamicQuery the dynamic query
105            * @param start the lower bound of the range of model instances
106            * @param end the upper bound of the range of model instances (not inclusive)
107            * @return the range of matching rows
108            * @throws SystemException if a system exception occurred
109            */
110            @SuppressWarnings("rawtypes")
111            public java.util.List dynamicQuery(
112                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
113                    int end) throws com.liferay.portal.kernel.exception.SystemException;
114    
115            /**
116            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
117            *
118            * <p>
119            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
120            * </p>
121            *
122            * @param dynamicQuery the dynamic query
123            * @param start the lower bound of the range of model instances
124            * @param end the upper bound of the range of model instances (not inclusive)
125            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
126            * @return the ordered range of matching rows
127            * @throws SystemException if a system exception occurred
128            */
129            @SuppressWarnings("rawtypes")
130            public java.util.List dynamicQuery(
131                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
132                    int end,
133                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
134                    throws com.liferay.portal.kernel.exception.SystemException;
135    
136            /**
137            * Returns the number of rows that match the dynamic query.
138            *
139            * @param dynamicQuery the dynamic query
140            * @return the number of rows that match the dynamic query
141            * @throws SystemException if a system exception occurred
142            */
143            public long dynamicQueryCount(
144                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
145                    throws com.liferay.portal.kernel.exception.SystemException;
146    
147            @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
305            found
306            * @throws SystemException if a system exception occurred
307            */
308            public void addUserPermissions(long userId, java.lang.String[] actionIds,
309                    long resourceId)
310                    throws com.liferay.portal.kernel.exception.PortalException,
311                            com.liferay.portal.kernel.exception.SystemException;
312    
313            /**
314            * Checks to see if the actions are permitted on the named resource.
315            *
316            * @param name the resource name
317            * @param actionIds the primary keys of the actions
318            * @throws PortalException if the resource company or name could not be
319            found or were invalid
320            * @throws SystemException if a system exception occurred
321            */
322            public void checkPermissions(java.lang.String name,
323                    java.util.List<java.lang.String> actionIds)
324                    throws com.liferay.portal.kernel.exception.PortalException,
325                            com.liferay.portal.kernel.exception.SystemException;
326    
327            /**
328            * Returns the IDs of all the actions belonging to the permissions.
329            *
330            * @param permissions the permissions
331            * @return the IDs of all the actions belonging to the permissions
332            */
333            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
334            public java.util.List<java.lang.String> getActions(
335                    java.util.List<com.liferay.portal.model.Permission> permissions);
336    
337            /**
338            * Returns all the group's permissions on the resource.
339            *
340            * @param groupId the primary key of the group
341            * @param resourceId the primary key of the resource
342            * @return the group's permissions on the resource
343            * @throws SystemException if a system exception occurred
344            */
345            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
346            public java.util.List<com.liferay.portal.model.Permission> getGroupPermissions(
347                    long groupId, long resourceId)
348                    throws com.liferay.portal.kernel.exception.SystemException;
349    
350            /**
351            * Returns all the group's permissions on the named resource with the scope
352            * and primKey.
353            *
354            * @param groupId the primary key of the group
355            * @param companyId the primary key of the company
356            * @param name the resource name
357            * @param scope the resource scope
358            * @param primKey the resource primKey
359            * @return the group's permissions on the named resource with the scope and
360            primKey
361            * @throws SystemException if a system exception occurred
362            */
363            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
364            public java.util.List<com.liferay.portal.model.Permission> getGroupPermissions(
365                    long groupId, long companyId, java.lang.String name, int scope,
366                    java.lang.String primKey)
367                    throws com.liferay.portal.kernel.exception.SystemException;
368    
369            /**
370            * Returns the primary key of the latest permission created.
371            *
372            * @return the primary key of the latest permission created
373            * @throws SystemException if a system exception occurred
374            */
375            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
376            public long getLatestPermissionId()
377                    throws com.liferay.portal.kernel.exception.SystemException;
378    
379            /**
380            * Returns all the permissions of the organization's group with respect to
381            * the resource.
382            *
383            * @param organizationId the primary key of the organization
384            * @param groupId the primary key of the group
385            * @param resourceId the primary key of the resource
386            * @return the permissions of the organization's group with respect to the
387            resource
388            * @throws SystemException if a system exception occurred
389            */
390            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
391            public java.util.List<com.liferay.portal.model.Permission> getOrgGroupPermissions(
392                    long organizationId, long groupId, long resourceId)
393                    throws com.liferay.portal.kernel.exception.SystemException;
394    
395            /**
396            * Returns all the permissions to perform the actions on the resource,
397            * creating new permissions for any permissions not found.
398            *
399            * @param companyId the primary key of the company
400            * @param actionIds the primary keys of the actions
401            * @param resourceId the primary key of the resource
402            * @return the permissions to perform the actions on the resource
403            * @throws SystemException if a system exception occurred
404            * @see #addPermission(long, String, long)
405            */
406            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
407            public java.util.List<com.liferay.portal.model.Permission> getPermissions(
408                    long companyId, java.lang.String[] actionIds, long resourceId)
409                    throws com.liferay.portal.kernel.exception.SystemException;
410    
411            /**
412            * Returns all the role's permissions.
413            *
414            * @param roleId the primary key of the role
415            * @return the role's permissions
416            * @throws SystemException if a system exception occurred
417            */
418            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
419            public java.util.List<com.liferay.portal.model.Permission> getRolePermissions(
420                    long roleId) throws com.liferay.portal.kernel.exception.SystemException;
421    
422            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
423            public java.util.List<com.liferay.portal.model.Permission> getRolePermissions(
424                    long roleId, int[] scopes)
425                    throws com.liferay.portal.kernel.exception.SystemException;
426    
427            /**
428            * Returns all the role's permissions on the resource.
429            *
430            * @param roleId the primary key of the role
431            * @param resourceId the primary key of the resource
432            * @return the role's permissions on the resource
433            * @throws SystemException if a system exception occurred
434            */
435            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
436            public java.util.List<com.liferay.portal.model.Permission> getRolePermissions(
437                    long roleId, long resourceId)
438                    throws com.liferay.portal.kernel.exception.SystemException;
439    
440            /**
441            * Returns all the user's permissions.
442            *
443            * @param userId the primary key of the user
444            * @return the user's permissions
445            * @throws SystemException if a system exception occurred
446            */
447            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
448            public java.util.List<com.liferay.portal.model.Permission> getUserPermissions(
449                    long userId) throws com.liferay.portal.kernel.exception.SystemException;
450    
451            /**
452            * Returns all the user's permissions on the resource.
453            *
454            * @param userId the primary key of the user
455            * @param resourceId the primary key of the resource
456            * @return the user's permissions on the resource
457            * @throws SystemException if a system exception occurred
458            */
459            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
460            public java.util.List<com.liferay.portal.model.Permission> getUserPermissions(
461                    long userId, long resourceId)
462                    throws com.liferay.portal.kernel.exception.SystemException;
463    
464            /**
465            * Returns all the user's permissions on the named resource with the scope
466            * and primKey.
467            *
468            * @param userId the primary key of the user
469            * @param companyId the primary key of the company
470            * @param name the resource name
471            * @param scope the resource scope
472            * @param primKey the resource primKey
473            * @return the user permissions of the resource name, scope, and primKey
474            * @throws SystemException if a system exception occurred
475            */
476            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
477            public java.util.List<com.liferay.portal.model.Permission> getUserPermissions(
478                    long userId, long companyId, java.lang.String name, int scope,
479                    java.lang.String primKey)
480                    throws com.liferay.portal.kernel.exception.SystemException;
481    
482            /**
483            * Returns <code>true</code> if the group has permission to perform the
484            * action on the resource.
485            *
486            * @param groupId the primary key of the group
487            * @param actionId the action's ID
488            * @param resourceId the primary key of the resource
489            * @return <code>true</code> if the group has permission to perform the
490            action on the resource; <code>false</code> otherwise
491            * @throws SystemException if a system exception occurred
492            */
493            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
494            public boolean hasGroupPermission(long groupId, java.lang.String actionId,
495                    long resourceId)
496                    throws com.liferay.portal.kernel.exception.SystemException;
497    
498            /**
499            * Returns <code>true</code> if the role has permission to perform the
500            * action on the named resource with the scope.
501            *
502            * @param roleId the primary key of the role
503            * @param companyId the primary key of the company
504            * @param name the resource name
505            * @param scope the resource scope
506            * @param actionId the action's ID
507            * @return <code>true</code> if the role has permission to perform the
508            action on the named resource with the scope; <code>false</code>
509            otherwise
510            * @throws SystemException if a system exception occurred
511            */
512            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
513            public boolean hasRolePermission(long roleId, long companyId,
514                    java.lang.String name, int scope, java.lang.String actionId)
515                    throws com.liferay.portal.kernel.exception.SystemException;
516    
517            /**
518            * Returns <code>true</code> if the role has permission to perform the
519            * action on the named resource with the scope and primKey.
520            *
521            * @param roleId the primary key of the role
522            * @param companyId the primary key of the company
523            * @param name the resource name
524            * @param scope the resource scope
525            * @param primKey the resource primKey
526            * @param actionId the action's ID
527            * @return <code>true</code> if the role has permission to perform the
528            action on the named resource with the scope and primKey;
529            <code>false</code> otherwise
530            * @throws SystemException if a system exception occurred
531            */
532            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
533            public boolean hasRolePermission(long roleId, long companyId,
534                    java.lang.String name, int scope, java.lang.String primKey,
535                    java.lang.String actionId)
536                    throws com.liferay.portal.kernel.exception.SystemException;
537    
538            /**
539            * Returns <code>true</code> if the user has permission to perform the
540            * action on the resource.
541            *
542            * @param userId the primary key of the user
543            * @param actionId the action's ID
544            * @param resourceId the primary key of the resource
545            * @return <code>true</code> if the user has permission to perform the
546            action on the resource; <code>false</code> otherwise
547            * @throws SystemException if a system exception occurred
548            */
549            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
550            public boolean hasUserPermission(long userId, java.lang.String actionId,
551                    long resourceId)
552                    throws com.liferay.portal.kernel.exception.SystemException;
553    
554            /**
555            * Returns <code>true</code> if the user has permission to perform the
556            * action on the resources.
557            *
558            * <p>
559            * This method does not support resources managed by the resource block
560            * system.
561            * </p>
562            *
563            * @param userId the primary key of the user
564            * @param groupId the primary key of the group containing the resource
565            * @param resources representations of the resource at each scope level
566            returned by {@link
567            com.liferay.portal.security.permission.AdvancedPermissionChecker#getResources(
568            long, long, String, String, String)}
569            * @param actionId the action's ID
570            * @param permissionCheckerBag the permission checker bag
571            * @return <code>true</code> if the user has permission to perform the
572            action on the resources; <code>false</code> otherwise
573            * @throws PortalException if a resource action based on any one of the
574            resources and the action ID could not be found
575            * @throws SystemException if a system exception occurred
576            */
577            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
578            public boolean hasUserPermissions(long userId, long groupId,
579                    java.util.List<com.liferay.portal.model.Resource> resources,
580                    java.lang.String actionId,
581                    com.liferay.portal.security.permission.PermissionCheckerBag permissionCheckerBag)
582                    throws com.liferay.portal.kernel.exception.PortalException,
583                            com.liferay.portal.kernel.exception.SystemException;
584    
585            /**
586            * Sets the container wide permissions of either the role or the default
587            * user of each company to perform the actions on the named resource.
588            *
589            * @param name the resource name
590            * @param roleName the role name. Supported role names include {@link
591            com.liferay.portal.model.RoleConstants#ORGANIZATION_USER},
592            {@link com.liferay.portal.model.RoleConstants#OWNER}, and {@link
593            com.liferay.portal.model.RoleConstants#SITE_MEMBER}.
594            * @param actionId the action's ID
595            * @throws PortalException if a matching role could not be found or if a
596            default user for the company could not be found
597            * @throws SystemException if a system exception occurred
598            */
599            public void setContainerResourcePermissions(java.lang.String name,
600                    java.lang.String roleName, java.lang.String actionId)
601                    throws com.liferay.portal.kernel.exception.PortalException,
602                            com.liferay.portal.kernel.exception.SystemException;
603    
604            /**
605            * Sets the group's permissions to perform the actions on the resource,
606            * replacing the group's existing permissions on the resource.
607            *
608            * @param groupId the primary key of the group
609            * @param actionIds the primary keys of the actions
610            * @param resourceId the primary key of the resource
611            * @throws PortalException if a group with the primary key could not be
612            found
613            * @throws SystemException if a system exception occurred
614            */
615            public void setGroupPermissions(long groupId, java.lang.String[] actionIds,
616                    long resourceId)
617                    throws com.liferay.portal.kernel.exception.PortalException,
618                            com.liferay.portal.kernel.exception.SystemException;
619    
620            /**
621            * Sets the entity's group permissions to perform the actions on the
622            * resource, replacing the entity's existing group permissions on the
623            * resource. Only {@link com.liferay.portal.model.Organization} and {@link
624            * com.liferay.portal.model.UserGroup} class entities are supported.
625            *
626            * @param className the class name of an organization or user group
627            * @param classPK the primary key of the class
628            * @param groupId the primary key of the group
629            * @param actionIds the primary keys of the actions
630            * @param resourceId the primary key of the resource
631            * @throws PortalException if an entity with the class name and primary key
632            could not be found or if the entity's associated group could not
633            be found
634            * @throws SystemException if a system exception occurred
635            */
636            public void setGroupPermissions(java.lang.String className,
637                    java.lang.String classPK, long groupId, java.lang.String[] actionIds,
638                    long resourceId)
639                    throws com.liferay.portal.kernel.exception.PortalException,
640                            com.liferay.portal.kernel.exception.SystemException;
641    
642            /**
643            * Sets the organization's group permissions to perform the actions on the
644            * resource, replacing the organization's existing group permissions on the
645            * resource.
646            *
647            * @param organizationId the primary key of the organization
648            * @param groupId the primary key of the group in which to scope the
649            permissions
650            * @param actionIds the primary keys of the actions
651            * @param resourceId the primary key of the resource
652            * @throws PortalException if an organization with the primary key could
653            not be found
654            * @throws SystemException if a system exception occurred
655            */
656            public void setOrgGroupPermissions(long organizationId, long groupId,
657                    java.lang.String[] actionIds, long resourceId)
658                    throws com.liferay.portal.kernel.exception.PortalException,
659                            com.liferay.portal.kernel.exception.SystemException;
660    
661            /**
662            * Sets the role's permissions to perform the action on the named resource,
663            * replacing the role's existing permissions on the resource.
664            *
665            * @param roleId the primary key of the role
666            * @param companyId the primary key of the company
667            * @param name the resource name
668            * @param scope the resource scope
669            * @param primKey the resource primKey
670            * @param actionId the action's ID
671            * @throws PortalException if the scope was {@link
672            com.liferay.portal.model.ResourceConstants#SCOPE_INDIVIDUAL}
673            * @throws SystemException if a system exception occurred
674            */
675            public void setRolePermission(long roleId, long companyId,
676                    java.lang.String name, int scope, java.lang.String primKey,
677                    java.lang.String actionId)
678                    throws com.liferay.portal.kernel.exception.PortalException,
679                            com.liferay.portal.kernel.exception.SystemException;
680    
681            /**
682            * Sets the role's permissions to perform the actions on the named
683            * resource, replacing the role's existing permission for each of these
684            * actions on the resource.
685            *
686            * @param roleId the primary key of the role
687            * @param companyId the primary key of the company
688            * @param name the resource name
689            * @param scope the resource scope
690            * @param primKey the resource primKey
691            * @param actionIds the primary keys of the actions
692            * @throws PortalException if the scope was {@link
693            com.liferay.portal.model.ResourceConstants#SCOPE_INDIVIDUAL}
694            * @throws SystemException if a system exception occurred
695            */
696            public void setRolePermissions(long roleId, long companyId,
697                    java.lang.String name, int scope, java.lang.String primKey,
698                    java.lang.String[] actionIds)
699                    throws com.liferay.portal.kernel.exception.PortalException,
700                            com.liferay.portal.kernel.exception.SystemException;
701    
702            /**
703            * Sets the role's permissions to perform the actions on the resource,
704            * replacing the role's existing permissions on the resource.
705            *
706            * @param roleId the primary key of the role
707            * @param actionIds the primary keys of the actions
708            * @param resourceId the primary key of the resource
709            * @throws PortalException if a role with the primary key could not be
710            found
711            * @throws SystemException if a system exception occurred
712            */
713            public void setRolePermissions(long roleId, java.lang.String[] actionIds,
714                    long resourceId)
715                    throws com.liferay.portal.kernel.exception.PortalException,
716                            com.liferay.portal.kernel.exception.SystemException;
717    
718            /**
719            * Sets the permissions of each role to perform respective actions on the
720            * resource, replacing the existing permissions of each role on the
721            * resource.
722            *
723            * @param companyId the primary key of the company
724            * @param roleIdsToActionIds the map of roles to their new actions on the
725            resource
726            * @param resourceId the primary key of the resource
727            * @throws SystemException if a system exception occurred
728            */
729            public void setRolesPermissions(long companyId,
730                    java.util.Map<java.lang.Long, java.lang.String[]> roleIdsToActionIds,
731                    long resourceId)
732                    throws com.liferay.portal.kernel.exception.SystemException;
733    
734            /**
735            * Sets the permissions of each role to perform respective actions on the
736            * named resource, replacing the existing permissions of each role on the
737            * resource.
738            *
739            * @param companyId the primary key of the company
740            * @param roleIdsToActionIds the map of roles to their new actions on the
741            resource
742            * @param name the resource name
743            * @param scope the resource scope
744            * @param primKey the resource primKey
745            * @throws SystemException if a system exception occurred
746            */
747            public void setRolesPermissions(long companyId,
748                    java.util.Map<java.lang.Long, java.lang.String[]> roleIdsToActionIds,
749                    java.lang.String name, int scope, java.lang.String primKey)
750                    throws com.liferay.portal.kernel.exception.SystemException;
751    
752            /**
753            * Sets the user's permissions to perform the actions on the resource,
754            * replacing the user's existing permissions on the resource.
755            *
756            * @param userId the primary key of the user
757            * @param actionIds the primary keys of the actions
758            * @param resourceId the primary key of the resource
759            * @throws PortalException if a user with the primary key could not be
760            found
761            * @throws SystemException if a system exception occurred
762            */
763            public void setUserPermissions(long userId, java.lang.String[] actionIds,
764                    long resourceId)
765                    throws com.liferay.portal.kernel.exception.PortalException,
766                            com.liferay.portal.kernel.exception.SystemException;
767    
768            /**
769            * Removes the permission from the role.
770            *
771            * @param roleId the primary key of the role
772            * @param permissionId the primary key of the permission
773            * @throws SystemException if a system exception occurred
774            */
775            public void unsetRolePermission(long roleId, long permissionId)
776                    throws com.liferay.portal.kernel.exception.SystemException;
777    
778            /**
779            * Removes the role's permissions to perform the action on the named
780            * resource with the scope and primKey.
781            *
782            * @param roleId the primary key of the role
783            * @param companyId the primary key of the company
784            * @param name the resource name
785            * @param scope the resource scope
786            * @param primKey the resource primKey
787            * @param actionId the action's ID
788            * @throws SystemException if a system exception occurred
789            */
790            public void unsetRolePermission(long roleId, long companyId,
791                    java.lang.String name, int scope, java.lang.String primKey,
792                    java.lang.String actionId)
793                    throws com.liferay.portal.kernel.exception.SystemException;
794    
795            /**
796            * Removes the role's permissions to perform the action on the named
797            * resource.
798            *
799            * @param roleId the primary key of the role
800            * @param companyId the primary key of the company
801            * @param name the resource name
802            * @param scope the resource scope
803            * @param actionId the action's ID
804            * @throws SystemException if a system exception occurred
805            */
806            public void unsetRolePermissions(long roleId, long companyId,
807                    java.lang.String name, int scope, java.lang.String actionId)
808                    throws com.liferay.portal.kernel.exception.SystemException;
809    
810            /**
811            * Removes the user's permissions to perform the actions on the resource.
812            *
813            * @param userId the primary key of the user
814            * @param actionIds the primary keys of the actions
815            * @param resourceId the primary key of the resource
816            * @throws SystemException if a system exception occurred
817            */
818            public void unsetUserPermissions(long userId, java.lang.String[] actionIds,
819                    long resourceId)
820                    throws com.liferay.portal.kernel.exception.SystemException;
821    }