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