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    /**
018     * <p>
019     * This class is a wrapper for {@link ResourcePermissionLocalService}.
020     * </p>
021     *
022     * @author    Brian Wing Shun Chan
023     * @see       ResourcePermissionLocalService
024     * @generated
025     */
026    public class ResourcePermissionLocalServiceWrapper
027            implements ResourcePermissionLocalService {
028            public ResourcePermissionLocalServiceWrapper(
029                    ResourcePermissionLocalService resourcePermissionLocalService) {
030                    _resourcePermissionLocalService = resourcePermissionLocalService;
031            }
032    
033            /**
034            * Adds the resource permission to the database. Also notifies the appropriate model listeners.
035            *
036            * @param resourcePermission the resource permission
037            * @return the resource permission that was added
038            * @throws SystemException if a system exception occurred
039            */
040            public com.liferay.portal.model.ResourcePermission addResourcePermission(
041                    com.liferay.portal.model.ResourcePermission resourcePermission)
042                    throws com.liferay.portal.kernel.exception.SystemException {
043                    return _resourcePermissionLocalService.addResourcePermission(resourcePermission);
044            }
045    
046            /**
047            * Creates a new resource permission with the primary key. Does not add the resource permission to the database.
048            *
049            * @param resourcePermissionId the primary key for the new resource permission
050            * @return the new resource permission
051            */
052            public com.liferay.portal.model.ResourcePermission createResourcePermission(
053                    long resourcePermissionId) {
054                    return _resourcePermissionLocalService.createResourcePermission(resourcePermissionId);
055            }
056    
057            /**
058            * Deletes the resource permission with the primary key from the database. Also notifies the appropriate model listeners.
059            *
060            * @param resourcePermissionId the primary key of the resource permission
061            * @throws PortalException if a resource permission with the primary key could not be found
062            * @throws SystemException if a system exception occurred
063            */
064            public void deleteResourcePermission(long resourcePermissionId)
065                    throws com.liferay.portal.kernel.exception.PortalException,
066                            com.liferay.portal.kernel.exception.SystemException {
067                    _resourcePermissionLocalService.deleteResourcePermission(resourcePermissionId);
068            }
069    
070            /**
071            * Deletes the resource permission from the database. Also notifies the appropriate model listeners.
072            *
073            * @param resourcePermission the resource permission
074            * @throws SystemException if a system exception occurred
075            */
076            public void deleteResourcePermission(
077                    com.liferay.portal.model.ResourcePermission resourcePermission)
078                    throws com.liferay.portal.kernel.exception.SystemException {
079                    _resourcePermissionLocalService.deleteResourcePermission(resourcePermission);
080            }
081    
082            /**
083            * Performs a dynamic query on the database and returns the matching rows.
084            *
085            * @param dynamicQuery the dynamic query
086            * @return the matching rows
087            * @throws SystemException if a system exception occurred
088            */
089            @SuppressWarnings("rawtypes")
090            public java.util.List dynamicQuery(
091                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
092                    throws com.liferay.portal.kernel.exception.SystemException {
093                    return _resourcePermissionLocalService.dynamicQuery(dynamicQuery);
094            }
095    
096            /**
097            * Performs a dynamic query on the database and returns a range of the matching rows.
098            *
099            * <p>
100            * 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.
101            * </p>
102            *
103            * @param dynamicQuery the dynamic query
104            * @param start the lower bound of the range of model instances
105            * @param end the upper bound of the range of model instances (not inclusive)
106            * @return the range of matching rows
107            * @throws SystemException if a system exception occurred
108            */
109            @SuppressWarnings("rawtypes")
110            public java.util.List dynamicQuery(
111                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
112                    int end) throws com.liferay.portal.kernel.exception.SystemException {
113                    return _resourcePermissionLocalService.dynamicQuery(dynamicQuery,
114                            start, end);
115            }
116    
117            /**
118            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
119            *
120            * <p>
121            * 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.
122            * </p>
123            *
124            * @param dynamicQuery the dynamic query
125            * @param start the lower bound of the range of model instances
126            * @param end the upper bound of the range of model instances (not inclusive)
127            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
128            * @return the ordered range of matching rows
129            * @throws SystemException if a system exception occurred
130            */
131            @SuppressWarnings("rawtypes")
132            public java.util.List dynamicQuery(
133                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
134                    int end,
135                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
136                    throws com.liferay.portal.kernel.exception.SystemException {
137                    return _resourcePermissionLocalService.dynamicQuery(dynamicQuery,
138                            start, end, orderByComparator);
139            }
140    
141            /**
142            * Returns the number of rows that match the dynamic query.
143            *
144            * @param dynamicQuery the dynamic query
145            * @return the number of rows that match the dynamic query
146            * @throws SystemException if a system exception occurred
147            */
148            public long dynamicQueryCount(
149                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
150                    throws com.liferay.portal.kernel.exception.SystemException {
151                    return _resourcePermissionLocalService.dynamicQueryCount(dynamicQuery);
152            }
153    
154            /**
155            * Returns the resource permission with the primary key.
156            *
157            * @param resourcePermissionId the primary key of the resource permission
158            * @return the resource permission
159            * @throws PortalException if a resource permission with the primary key could not be found
160            * @throws SystemException if a system exception occurred
161            */
162            public com.liferay.portal.model.ResourcePermission getResourcePermission(
163                    long resourcePermissionId)
164                    throws com.liferay.portal.kernel.exception.PortalException,
165                            com.liferay.portal.kernel.exception.SystemException {
166                    return _resourcePermissionLocalService.getResourcePermission(resourcePermissionId);
167            }
168    
169            public com.liferay.portal.model.PersistedModel getPersistedModel(
170                    java.io.Serializable primaryKeyObj)
171                    throws com.liferay.portal.kernel.exception.PortalException,
172                            com.liferay.portal.kernel.exception.SystemException {
173                    return _resourcePermissionLocalService.getPersistedModel(primaryKeyObj);
174            }
175    
176            /**
177            * Returns a range of all the resource permissions.
178            *
179            * <p>
180            * 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.
181            * </p>
182            *
183            * @param start the lower bound of the range of resource permissions
184            * @param end the upper bound of the range of resource permissions (not inclusive)
185            * @return the range of resource permissions
186            * @throws SystemException if a system exception occurred
187            */
188            public java.util.List<com.liferay.portal.model.ResourcePermission> getResourcePermissions(
189                    int start, int end)
190                    throws com.liferay.portal.kernel.exception.SystemException {
191                    return _resourcePermissionLocalService.getResourcePermissions(start, end);
192            }
193    
194            /**
195            * Returns the number of resource permissions.
196            *
197            * @return the number of resource permissions
198            * @throws SystemException if a system exception occurred
199            */
200            public int getResourcePermissionsCount()
201                    throws com.liferay.portal.kernel.exception.SystemException {
202                    return _resourcePermissionLocalService.getResourcePermissionsCount();
203            }
204    
205            /**
206            * Updates the resource permission in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
207            *
208            * @param resourcePermission the resource permission
209            * @return the resource permission that was updated
210            * @throws SystemException if a system exception occurred
211            */
212            public com.liferay.portal.model.ResourcePermission updateResourcePermission(
213                    com.liferay.portal.model.ResourcePermission resourcePermission)
214                    throws com.liferay.portal.kernel.exception.SystemException {
215                    return _resourcePermissionLocalService.updateResourcePermission(resourcePermission);
216            }
217    
218            /**
219            * Updates the resource permission in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
220            *
221            * @param resourcePermission the resource permission
222            * @param merge whether to merge the resource 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.
223            * @return the resource permission that was updated
224            * @throws SystemException if a system exception occurred
225            */
226            public com.liferay.portal.model.ResourcePermission updateResourcePermission(
227                    com.liferay.portal.model.ResourcePermission resourcePermission,
228                    boolean merge)
229                    throws com.liferay.portal.kernel.exception.SystemException {
230                    return _resourcePermissionLocalService.updateResourcePermission(resourcePermission,
231                            merge);
232            }
233    
234            /**
235            * Returns the Spring bean ID for this bean.
236            *
237            * @return the Spring bean ID for this bean
238            */
239            public java.lang.String getBeanIdentifier() {
240                    return _resourcePermissionLocalService.getBeanIdentifier();
241            }
242    
243            /**
244            * Sets the Spring bean ID for this bean.
245            *
246            * @param beanIdentifier the Spring bean ID for this bean
247            */
248            public void setBeanIdentifier(java.lang.String beanIdentifier) {
249                    _resourcePermissionLocalService.setBeanIdentifier(beanIdentifier);
250            }
251    
252            /**
253            * Grants the role permission at the scope to perform the action on
254            * resources of the type. Existing actions are retained.
255            *
256            * <p>
257            * This method cannot be used to grant individual scope permissions, but is
258            * only intended for adding permissions at the company, group, and
259            * group-template scopes. For example, this method could be used to grant a
260            * company scope permission to edit message board posts.
261            * </p>
262            *
263            * <p>
264            * If a company scope permission is granted to resources that the role
265            * already had group scope permissions to, the group scope permissions are
266            * deleted. Likewise, if a group scope permission is granted to resources
267            * that the role already had company scope permissions to, the company
268            * scope permissions are deleted. Be aware that this latter behavior can
269            * result in an overall reduction in permissions for the role.
270            * </p>
271            *
272            * <p>
273            * Depending on the scope, the value of <code>primKey</code> will have
274            * different meanings. For more information, see {@link
275            * com.liferay.portal.model.impl.ResourcePermissionImpl}.
276            * </p>
277            *
278            * @param companyId the primary key of the company
279            * @param name the resource's name, which can be either a class name or a
280            portlet ID
281            * @param scope the scope. This method only supports company, group, and
282            group-template scope.
283            * @param primKey the primary key
284            * @param roleId the primary key of the role
285            * @param actionId the action ID
286            * @throws PortalException if scope was set to individual scope or if a
287            role with the primary key or a resource action with the name and
288            action ID could not be found
289            * @throws SystemException if a system exception occurred
290            */
291            public void addResourcePermission(long companyId, java.lang.String name,
292                    int scope, java.lang.String primKey, long roleId,
293                    java.lang.String actionId)
294                    throws com.liferay.portal.kernel.exception.PortalException,
295                            com.liferay.portal.kernel.exception.SystemException {
296                    _resourcePermissionLocalService.addResourcePermission(companyId, name,
297                            scope, primKey, roleId, actionId);
298            }
299    
300            /**
301            * Grants the role permissions at the scope to perform the actions on all
302            * resources of the type. Existing actions are retained.
303            *
304            * <p>
305            * This method should only be used to add default permissions to existing
306            * resources en masse during upgrades or while verifying permissions. For
307            * example, this method could be used to grant site members individual
308            * scope permissions to view all blog posts.
309            * </p>
310            *
311            * @param resourceName the resource's name, which can be either a class
312            name or a portlet ID
313            * @param roleName the role's name
314            * @param scope the scope
315            * @param resourceActionBitwiseValue the bitwise IDs of the actions
316            * @throws SystemException if a system exception occurred
317            */
318            public void addResourcePermissions(java.lang.String resourceName,
319                    java.lang.String roleName, int scope, long resourceActionBitwiseValue)
320                    throws com.liferay.portal.kernel.exception.SystemException {
321                    _resourcePermissionLocalService.addResourcePermissions(resourceName,
322                            roleName, scope, resourceActionBitwiseValue);
323            }
324    
325            /**
326            * Deletes all resource permissions at the scope to resources of the type.
327            * This method should not be confused with any of the
328            * <code>removeResourcePermission</code> methods, as its purpose is very
329            * different. This method should only be used for deleting resource
330            * permissions that refer to a resource when that resource is deleted. For
331            * example this method could be used to delete all individual scope
332            * permissions to a blog post when it is deleted.
333            *
334            * <p>
335            * Depending on the scope, the value of <code>primKey</code> will have
336            * different meanings. For more information, see {@link
337            * com.liferay.portal.model.impl.ResourcePermissionImpl}.
338            * </p>
339            *
340            * @param companyId the primary key of the company
341            * @param name the resource's name, which can be either a class name or a
342            portlet ID
343            * @param scope the scope
344            * @param primKey the primary key
345            * @throws PortalException if a portal exception occurred
346            * @throws SystemException if a system exception occurred
347            */
348            public void deleteResourcePermissions(long companyId,
349                    java.lang.String name, int scope, long primKey)
350                    throws com.liferay.portal.kernel.exception.PortalException,
351                            com.liferay.portal.kernel.exception.SystemException {
352                    _resourcePermissionLocalService.deleteResourcePermissions(companyId,
353                            name, scope, primKey);
354            }
355    
356            /**
357            * Deletes all resource permissions at the scope to resources of the type.
358            * This method should not be confused with any of the
359            * <code>removeResourcePermission</code> methods, as its purpose is very
360            * different. This method should only be used for deleting resource
361            * permissions that refer to a resource when that resource is deleted. For
362            * example this method could be used to delete all individual scope
363            * permissions to a blog post when it is deleted.
364            *
365            * <p>
366            * Depending on the scope, the value of <code>primKey</code> will have
367            * different meanings. For more information, see {@link
368            * com.liferay.portal.model.impl.ResourcePermissionImpl}.
369            * </p>
370            *
371            * @param companyId the primary key of the company
372            * @param name the resource's name, which can be either a class name or a
373            portlet ID
374            * @param scope the scope
375            * @param primKey the primary key
376            * @throws PortalException if a portal exception occurred
377            * @throws SystemException if a system exception occurred
378            */
379            public void deleteResourcePermissions(long companyId,
380                    java.lang.String name, int scope, java.lang.String primKey)
381                    throws com.liferay.portal.kernel.exception.PortalException,
382                            com.liferay.portal.kernel.exception.SystemException {
383                    _resourcePermissionLocalService.deleteResourcePermissions(companyId,
384                            name, scope, primKey);
385            }
386    
387            /**
388            * Returns the intersection of action IDs the role has permission at the
389            * scope to perform on resources of the type.
390            *
391            * @param companyId he primary key of the company
392            * @param name the resource's name, which can be either a class name or a
393            portlet ID
394            * @param scope the scope
395            * @param primKey the primary key
396            * @param roleId the primary key of the role
397            * @param actionIds the action IDs
398            * @return the intersection of action IDs the role has permission at the
399            scope to perform on resources of the type
400            * @throws PortalException if a resouce action could not be found for any
401            one of the actions on the resource
402            * @throws SystemException if a system exception occurred
403            */
404            public java.util.List<java.lang.String> getAvailableResourcePermissionActionIds(
405                    long companyId, java.lang.String name, int scope,
406                    java.lang.String primKey, long roleId,
407                    java.util.Collection<java.lang.String> actionIds)
408                    throws com.liferay.portal.kernel.exception.PortalException,
409                            com.liferay.portal.kernel.exception.SystemException {
410                    return _resourcePermissionLocalService.getAvailableResourcePermissionActionIds(companyId,
411                            name, scope, primKey, roleId, actionIds);
412            }
413    
414            /**
415            * Returns the resource permission for the role at the scope to perform the
416            * actions on resources of the type.
417            *
418            * @param companyId the primary key of the company
419            * @param name the resource's name, which can be either a class name or a
420            portlet ID
421            * @param scope the scope
422            * @param primKey the primary key
423            * @param roleId the primary key of the role
424            * @return the resource permission for the role at the scope to perform the
425            actions on resources of the type
426            * @throws PortalException if no matching resources could be found
427            * @throws SystemException if a system exception occurred
428            */
429            public com.liferay.portal.model.ResourcePermission getResourcePermission(
430                    long companyId, java.lang.String name, int scope,
431                    java.lang.String primKey, long roleId)
432                    throws com.liferay.portal.kernel.exception.PortalException,
433                            com.liferay.portal.kernel.exception.SystemException {
434                    return _resourcePermissionLocalService.getResourcePermission(companyId,
435                            name, scope, primKey, roleId);
436            }
437    
438            /**
439            * Returns all the resource permissions at the scope of the type.
440            *
441            * @param companyId the primary key of the company
442            * @param name the resource's name, which can be either a class name or a
443            portlet ID
444            * @param scope the scope
445            * @param primKey the primary key
446            * @return the resource permissions at the scope of the type
447            * @throws SystemException if a system exception occurred
448            */
449            public java.util.List<com.liferay.portal.model.ResourcePermission> getResourcePermissions(
450                    long companyId, java.lang.String name, int scope,
451                    java.lang.String primKey)
452                    throws com.liferay.portal.kernel.exception.SystemException {
453                    return _resourcePermissionLocalService.getResourcePermissions(companyId,
454                            name, scope, primKey);
455            }
456    
457            /**
458            * Returns the number of resource permissions at the scope of the type.
459            *
460            * @param companyId the primary key of the company
461            * @param name the resource's name, which can be either a class name or a
462            portlet ID
463            * @param scope the scope
464            * @param primKey the primary key
465            * @return the number of resource permissions at the scope of the type
466            * @throws SystemException if a system exception occurred
467            */
468            public int getResourcePermissionsCount(long companyId,
469                    java.lang.String name, int scope, java.lang.String primKey)
470                    throws com.liferay.portal.kernel.exception.SystemException {
471                    return _resourcePermissionLocalService.getResourcePermissionsCount(companyId,
472                            name, scope, primKey);
473            }
474    
475            /**
476            * Returns the resource permissions that apply to the resource.
477            *
478            * @param companyId the primary key of the resource's company
479            * @param groupId the primary key of the resource's group
480            * @param name the resource's name, which can be either a class name or a
481            portlet ID
482            * @param primKey the primary key of the resource
483            * @return the resource permissions associated with the resource
484            * @throws SystemException if a system exception occurred
485            */
486            public java.util.List<com.liferay.portal.model.ResourcePermission> getResourceResourcePermissions(
487                    long companyId, long groupId, java.lang.String name,
488                    java.lang.String primKey)
489                    throws com.liferay.portal.kernel.exception.SystemException {
490                    return _resourcePermissionLocalService.getResourceResourcePermissions(companyId,
491                            groupId, name, primKey);
492            }
493    
494            /**
495            * Returns all the resource permissions for the role.
496            *
497            * @param roleId the primary key of the role
498            * @return the resource permissions for the role
499            * @throws SystemException if a system exception occurred
500            */
501            public java.util.List<com.liferay.portal.model.ResourcePermission> getRoleResourcePermissions(
502                    long roleId) throws com.liferay.portal.kernel.exception.SystemException {
503                    return _resourcePermissionLocalService.getRoleResourcePermissions(roleId);
504            }
505    
506            /**
507            * Returns a range of all the resource permissions for the role at the
508            * scopes.
509            *
510            * <p>
511            * Useful when paginating results. Returns a maximum of <code>end -
512            * start</code> instances. <code>start</code> and <code>end</code> are not
513            * primary keys, they are indexes in the result set. Thus, <code>0</code>
514            * refers to the first result in the set. Setting both <code>start</code>
515            * and <code>end</code> to {@link
516            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the
517            * full result set.
518            * </p>
519            *
520            * @param roleId the primary key of the role
521            * @param scopes the scopes
522            * @param start the lower bound of the range of results
523            * @param end the upper bound of the range of results (not inclusive)
524            * @return the range of resource permissions for the role at the scopes
525            * @throws SystemException if a system exception occurred
526            */
527            public java.util.List<com.liferay.portal.model.ResourcePermission> getRoleResourcePermissions(
528                    long roleId, int[] scopes, int start, int end)
529                    throws com.liferay.portal.kernel.exception.SystemException {
530                    return _resourcePermissionLocalService.getRoleResourcePermissions(roleId,
531                            scopes, start, end);
532            }
533    
534            /**
535            * Returns all the resource permissions where scope = any &#63;.
536            *
537            * <p>
538            * Useful when paginating results. Returns a maximum of <code>end -
539            * start</code> instances. <code>start</code> and <code>end</code> are not
540            * primary keys, they are indexes in the result set. Thus, <code>0</code>
541            * refers to the first result in the set. Setting both <code>start</code>
542            * and <code>end</code> to {@link
543            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the
544            * full result set.
545            * </p>
546            *
547            * @param scopes the scopes
548            * @return the resource permissions where scope = any &#63;
549            * @throws SystemException if a system exception occurred
550            */
551            public java.util.List<com.liferay.portal.model.ResourcePermission> getScopeResourcePermissions(
552                    int[] scopes)
553                    throws com.liferay.portal.kernel.exception.SystemException {
554                    return _resourcePermissionLocalService.getScopeResourcePermissions(scopes);
555            }
556    
557            /**
558            * Returns <code>true</code> if the resource permission grants permission
559            * to perform the resource action. Note that this method does not ensure
560            * that the resource permission refers to the same type of resource as the
561            * resource action.
562            *
563            * @param resourcePermission the resource permission
564            * @param resourceAction the resource action
565            * @return <code>true</code> if the resource permission grants permission
566            to perform the resource action
567            */
568            public boolean hasActionId(
569                    com.liferay.portal.model.ResourcePermission resourcePermission,
570                    com.liferay.portal.model.ResourceAction resourceAction) {
571                    return _resourcePermissionLocalService.hasActionId(resourcePermission,
572                            resourceAction);
573            }
574    
575            /**
576            * Returns <code>true</code> if the roles have permission at the scope to
577            * perform the action on the resources.
578            *
579            * <p>
580            * Depending on the scope, the value of <code>primKey</code> will have
581            * different meanings. For more information, see {@link
582            * com.liferay.portal.model.impl.ResourcePermissionImpl}.
583            * </p>
584            *
585            * @param resources the resources
586            * @param roleIds the primary keys of the roles
587            * @param actionId the action ID
588            * @return <code>true</code> if any one of the roles has permission to
589            perform the action on any one of the resources;
590            <code>false</code> otherwise
591            * @throws PortalException if any one of the roles with the primary keys
592            could not be found or if a resource action with the name and
593            action ID could not be found
594            * @throws SystemException if a system exception occurred
595            */
596            public boolean hasResourcePermission(
597                    java.util.List<com.liferay.portal.model.Resource> resources,
598                    long[] roleIds, java.lang.String actionId)
599                    throws com.liferay.portal.kernel.exception.PortalException,
600                            com.liferay.portal.kernel.exception.SystemException {
601                    return _resourcePermissionLocalService.hasResourcePermission(resources,
602                            roleIds, actionId);
603            }
604    
605            /**
606            * Returns <code>true</code> if the role has permission at the scope to
607            * perform the action on resources of the type.
608            *
609            * <p>
610            * Depending on the scope, the value of <code>primKey</code> will have
611            * different meanings. For more information, see {@link
612            * com.liferay.portal.model.impl.ResourcePermissionImpl}.
613            * </p>
614            *
615            * @param companyId the primary key of the company
616            * @param name the resource's name, which can be either a class name or a
617            portlet ID
618            * @param scope the scope
619            * @param primKey the primary key
620            * @param roleId the primary key of the role
621            * @param actionId the action ID
622            * @return <code>true</code> if the role has permission to perform the
623            action on the resource; <code>false</code> otherwise
624            * @throws PortalException if a role with the primary key or a resource
625            action with the name and action ID could not be found
626            * @throws SystemException if a system exception occurred
627            */
628            public boolean hasResourcePermission(long companyId, java.lang.String name,
629                    int scope, java.lang.String primKey, long roleId,
630                    java.lang.String actionId)
631                    throws com.liferay.portal.kernel.exception.PortalException,
632                            com.liferay.portal.kernel.exception.SystemException {
633                    return _resourcePermissionLocalService.hasResourcePermission(companyId,
634                            name, scope, primKey, roleId, actionId);
635            }
636    
637            /**
638            * Returns <code>true</code> if the roles have permission at the scope to
639            * perform the action on resources of the type.
640            *
641            * <p>
642            * Depending on the scope, the value of <code>primKey</code> will have
643            * different meanings. For more information, see {@link
644            * com.liferay.portal.model.impl.ResourcePermissionImpl}.
645            * </p>
646            *
647            * @param companyId the primary key of the company
648            * @param name the resource's name, which can be either a class name or a
649            portlet ID
650            * @param scope the scope
651            * @param primKey the primary key
652            * @param roleIds the primary keys of the roles
653            * @param actionId the action ID
654            * @return <code>true</code> if any one of the roles has permission to
655            perform the action on the resource; <code>false</code> otherwise
656            * @throws PortalException if any one of the roles with the primary keys
657            could not be found or if a resource action with the name and
658            action ID could not be found
659            * @throws SystemException if a system exception occurred
660            */
661            public boolean hasResourcePermission(long companyId, java.lang.String name,
662                    int scope, java.lang.String primKey, long[] roleIds,
663                    java.lang.String actionId)
664                    throws com.liferay.portal.kernel.exception.PortalException,
665                            com.liferay.portal.kernel.exception.SystemException {
666                    return _resourcePermissionLocalService.hasResourcePermission(companyId,
667                            name, scope, primKey, roleIds, actionId);
668            }
669    
670            /**
671            * Returns <code>true</code> if the role has permission at the scope to
672            * perform the action on the resource.
673            *
674            * <p>
675            * Depending on the scope, the value of <code>primKey</code> will have
676            * different meanings. For more information, see {@link
677            * com.liferay.portal.model.impl.ResourcePermissionImpl}.
678            * </p>
679            *
680            * @param companyId the primary key of the company
681            * @param name the resource's name, which can be either a class name or a
682            portlet ID
683            * @param scope the scope
684            * @param roleId the primary key of the role
685            * @param actionId the action ID
686            * @return <code>true</code> if the role has permission to perform the
687            action on the resource; <code>false</code> otherwise
688            * @throws PortalException if a role with the primary key or a resource
689            action with the name and action ID could not be found
690            * @throws SystemException if a system exception occurred
691            */
692            public boolean hasScopeResourcePermission(long companyId,
693                    java.lang.String name, int scope, long roleId, java.lang.String actionId)
694                    throws com.liferay.portal.kernel.exception.PortalException,
695                            com.liferay.portal.kernel.exception.SystemException {
696                    return _resourcePermissionLocalService.hasScopeResourcePermission(companyId,
697                            name, scope, roleId, actionId);
698            }
699    
700            /**
701            * Reassigns all the resource permissions from the source role to the
702            * destination role, and deletes the source role.
703            *
704            * @param fromRoleId the primary key of the source role
705            * @param toRoleId the primary key of the destination role
706            * @throws PortalException if a role with the primary key could not be
707            found
708            * @throws SystemException if a system exception occurred
709            */
710            public void mergePermissions(long fromRoleId, long toRoleId)
711                    throws com.liferay.portal.kernel.exception.PortalException,
712                            com.liferay.portal.kernel.exception.SystemException {
713                    _resourcePermissionLocalService.mergePermissions(fromRoleId, toRoleId);
714            }
715    
716            /**
717            * Grants the role default permissions to all the resources of the type and
718            * at the scope stored in the resource permission, deletes the resource
719            * permission, and deletes the resource permission's role if it has no
720            * permissions remaining.
721            *
722            * @param resourcePermissionId the primary key of the resource permission
723            * @param toRoleId the primary key of the role
724            * @throws PortalException if a resource permission or role with the
725            primary key could not be found
726            * @throws SystemException if a system exception occurred
727            */
728            public void reassignPermissions(long resourcePermissionId, long toRoleId)
729                    throws com.liferay.portal.kernel.exception.PortalException,
730                            com.liferay.portal.kernel.exception.SystemException {
731                    _resourcePermissionLocalService.reassignPermissions(resourcePermissionId,
732                            toRoleId);
733            }
734    
735            /**
736            * Revokes permission at the scope from the role to perform the action on
737            * resources of the type. For example, this method could be used to revoke
738            * a group scope permission to edit blog posts.
739            *
740            * <p>
741            * Depending on the scope, the value of <code>primKey</code> will have
742            * different meanings. For more information, see {@link
743            * com.liferay.portal.model.impl.ResourcePermissionImpl}.
744            * </p>
745            *
746            * @param companyId the primary key of the company
747            * @param name the resource's name, which can be either a class name or a
748            portlet ID
749            * @param scope the scope
750            * @param primKey the primary key
751            * @param roleId the primary key of the role
752            * @param actionId the action ID
753            * @throws PortalException if a role with the primary key or a resource
754            action with the name and action ID could not be found
755            * @throws SystemException if a system exception occurred
756            */
757            public void removeResourcePermission(long companyId, java.lang.String name,
758                    int scope, java.lang.String primKey, long roleId,
759                    java.lang.String actionId)
760                    throws com.liferay.portal.kernel.exception.PortalException,
761                            com.liferay.portal.kernel.exception.SystemException {
762                    _resourcePermissionLocalService.removeResourcePermission(companyId,
763                            name, scope, primKey, roleId, actionId);
764            }
765    
766            /**
767            * Revokes all permissions at the scope from the role to perform the action
768            * on resources of the type. For example, this method could be used to
769            * revoke all individual scope permissions to edit blog posts from site
770            * members.
771            *
772            * @param companyId the primary key of the company
773            * @param name the resource's name, which can be either a class name or a
774            portlet ID
775            * @param scope the scope
776            * @param roleId the primary key of the role
777            * @param actionId the action ID
778            * @throws PortalException if a role with the primary key or a resource
779            action with the name and action ID could not be found
780            * @throws SystemException if a system exception occurred
781            */
782            public void removeResourcePermissions(long companyId,
783                    java.lang.String name, int scope, long roleId, java.lang.String actionId)
784                    throws com.liferay.portal.kernel.exception.PortalException,
785                            com.liferay.portal.kernel.exception.SystemException {
786                    _resourcePermissionLocalService.removeResourcePermissions(companyId,
787                            name, scope, roleId, actionId);
788            }
789    
790            /**
791            * Updates the role's permissions at the scope, setting the actions that
792            * can be performed on resources of the type, also setting the owner of any
793            * newly created resource permissions. Existing actions are replaced.
794            *
795            * <p>
796            * This method can be used to set permissions at any scope, but it is
797            * generally only used at the individual scope. For example, it could be
798            * used to set the guest permissions on a blog post.
799            * </p>
800            *
801            * <p>
802            * Depending on the scope, the value of <code>primKey</code> will have
803            * different meanings. For more information, see {@link
804            * com.liferay.portal.model.impl.ResourcePermissionImpl}.
805            * </p>
806            *
807            * @param companyId the primary key of the company
808            * @param name the resource's name, which can be either a class name or a
809            portlet ID
810            * @param scope the scope
811            * @param primKey the primary key
812            * @param roleId the primary key of the role
813            * @param ownerId the primary key of the owner (generally the user that
814            created the resource)
815            * @param actionIds the action IDs of the actions
816            * @throws PortalException if a role with the primary key or a resource
817            action with the name and action ID could not be found
818            * @throws SystemException if a system exception occurred
819            */
820            public void setOwnerResourcePermissions(long companyId,
821                    java.lang.String name, int scope, java.lang.String primKey,
822                    long roleId, long ownerId, java.lang.String[] actionIds)
823                    throws com.liferay.portal.kernel.exception.PortalException,
824                            com.liferay.portal.kernel.exception.SystemException {
825                    _resourcePermissionLocalService.setOwnerResourcePermissions(companyId,
826                            name, scope, primKey, roleId, ownerId, actionIds);
827            }
828    
829            /**
830            * Updates the role's permissions at the scope, setting the actions that
831            * can be performed on resources of the type. Existing actions are
832            * replaced.
833            *
834            * <p>
835            * This method can be used to set permissions at any scope, but it is
836            * generally only used at the individual scope. For example, it could be
837            * used to set the guest permissions on a blog post.
838            * </p>
839            *
840            * <p>
841            * Depending on the scope, the value of <code>primKey</code> will have
842            * different meanings. For more information, see {@link
843            * com.liferay.portal.model.impl.ResourcePermissionImpl}.
844            * </p>
845            *
846            * @param companyId the primary key of the company
847            * @param name the resource's name, which can be either a class name or a
848            portlet ID
849            * @param scope the scope
850            * @param primKey the primary key
851            * @param roleId the primary key of the role
852            * @param actionIds the action IDs of the actions
853            * @throws PortalException if a role with the primary key or a resource
854            action with the name and action ID could not be found
855            * @throws SystemException if a system exception occurred
856            */
857            public void setResourcePermissions(long companyId, java.lang.String name,
858                    int scope, java.lang.String primKey, long roleId,
859                    java.lang.String[] actionIds)
860                    throws com.liferay.portal.kernel.exception.PortalException,
861                            com.liferay.portal.kernel.exception.SystemException {
862                    _resourcePermissionLocalService.setResourcePermissions(companyId, name,
863                            scope, primKey, roleId, actionIds);
864            }
865    
866            /**
867            * Updates the role's permissions at the scope, setting the actions that can
868            * be performed on resources of the type. Existing actions are replaced.
869            *
870            * <p>
871            * This method can be used to set permissions at any scope, but it is
872            * generally only used at the individual scope. For example, it could be
873            * used to set the guest permissions on a blog post.
874            * </p>
875            *
876            * <p>
877            * Depending on the scope, the value of <code>primKey</code> will have
878            * different meanings. For more information, see {@link
879            * com.liferay.portal.model.impl.ResourcePermissionImpl}.
880            * </p>
881            *
882            * @param companyId the primary key of the company
883            * @param name the resource's name, which can be either a class name or a
884            portlet ID
885            * @param scope the scope
886            * @param primKey the primary key
887            * @param roleIdsToActionIds a map of role IDs to action IDs of the actions
888            * @throws PortalException if a role with the primary key or a resource
889            action with the name and action ID could not be found
890            * @throws SystemException if a system exception occurred
891            */
892            public void setResourcePermissions(long companyId, java.lang.String name,
893                    int scope, java.lang.String primKey,
894                    java.util.Map<java.lang.Long, java.lang.String[]> roleIdsToActionIds)
895                    throws com.liferay.portal.kernel.exception.PortalException,
896                            com.liferay.portal.kernel.exception.SystemException {
897                    _resourcePermissionLocalService.setResourcePermissions(companyId, name,
898                            scope, primKey, roleIdsToActionIds);
899            }
900    
901            public ResourcePermissionLocalService getWrappedResourcePermissionLocalService() {
902                    return _resourcePermissionLocalService;
903            }
904    
905            public void setWrappedResourcePermissionLocalService(
906                    ResourcePermissionLocalService resourcePermissionLocalService) {
907                    _resourcePermissionLocalService = resourcePermissionLocalService;
908            }
909    
910            private ResourcePermissionLocalService _resourcePermissionLocalService;
911    }