001    /**
002     * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.service;
016    
017    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    import com.liferay.portal.kernel.util.ReferenceRegistry;
019    
020    /**
021     * The utility for the permission local service. This utility wraps {@link com.liferay.portal.service.impl.PermissionLocalServiceImpl} and is the primary access point for service operations in application layer code running on the local server.
022     *
023     * <p>
024     * This is a local service. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM.
025     * </p>
026     *
027     * @author Brian Wing Shun Chan
028     * @see PermissionLocalService
029     * @see com.liferay.portal.service.base.PermissionLocalServiceBaseImpl
030     * @see com.liferay.portal.service.impl.PermissionLocalServiceImpl
031     * @generated
032     */
033    public class PermissionLocalServiceUtil {
034            /*
035             * NOTE FOR DEVELOPERS:
036             *
037             * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.PermissionLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
038             */
039    
040            /**
041            * Adds the permission to the database. Also notifies the appropriate model listeners.
042            *
043            * @param permission the permission
044            * @return the permission that was added
045            * @throws SystemException if a system exception occurred
046            */
047            public static com.liferay.portal.model.Permission addPermission(
048                    com.liferay.portal.model.Permission permission)
049                    throws com.liferay.portal.kernel.exception.SystemException {
050                    return getService().addPermission(permission);
051            }
052    
053            /**
054            * Creates a new permission with the primary key. Does not add the permission to the database.
055            *
056            * @param permissionId the primary key for the new permission
057            * @return the new permission
058            */
059            public static com.liferay.portal.model.Permission createPermission(
060                    long permissionId) {
061                    return getService().createPermission(permissionId);
062            }
063    
064            /**
065            * Deletes the permission with the primary key from the database. Also notifies the appropriate model listeners.
066            *
067            * @param permissionId the primary key of the permission
068            * @return the permission that was removed
069            * @throws PortalException if a permission with the primary key could not be found
070            * @throws SystemException if a system exception occurred
071            */
072            public static com.liferay.portal.model.Permission deletePermission(
073                    long permissionId)
074                    throws com.liferay.portal.kernel.exception.PortalException,
075                            com.liferay.portal.kernel.exception.SystemException {
076                    return getService().deletePermission(permissionId);
077            }
078    
079            /**
080            * Deletes the permission from the database. Also notifies the appropriate model listeners.
081            *
082            * @param permission the permission
083            * @return the permission that was removed
084            * @throws SystemException if a system exception occurred
085            */
086            public static com.liferay.portal.model.Permission deletePermission(
087                    com.liferay.portal.model.Permission permission)
088                    throws com.liferay.portal.kernel.exception.SystemException {
089                    return getService().deletePermission(permission);
090            }
091    
092            public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() {
093                    return getService().dynamicQuery();
094            }
095    
096            /**
097            * Performs a dynamic query on the database and returns the matching rows.
098            *
099            * @param dynamicQuery the dynamic query
100            * @return the matching rows
101            * @throws SystemException if a system exception occurred
102            */
103            @SuppressWarnings("rawtypes")
104            public static java.util.List dynamicQuery(
105                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
106                    throws com.liferay.portal.kernel.exception.SystemException {
107                    return getService().dynamicQuery(dynamicQuery);
108            }
109    
110            /**
111            * Performs a dynamic query on the database and returns a range of the matching rows.
112            *
113            * <p>
114            * 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.
115            * </p>
116            *
117            * @param dynamicQuery the dynamic query
118            * @param start the lower bound of the range of model instances
119            * @param end the upper bound of the range of model instances (not inclusive)
120            * @return the range of matching rows
121            * @throws SystemException if a system exception occurred
122            */
123            @SuppressWarnings("rawtypes")
124            public static java.util.List dynamicQuery(
125                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
126                    int end) throws com.liferay.portal.kernel.exception.SystemException {
127                    return getService().dynamicQuery(dynamicQuery, start, end);
128            }
129    
130            /**
131            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
132            *
133            * <p>
134            * 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.
135            * </p>
136            *
137            * @param dynamicQuery the dynamic query
138            * @param start the lower bound of the range of model instances
139            * @param end the upper bound of the range of model instances (not inclusive)
140            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
141            * @return the ordered range of matching rows
142            * @throws SystemException if a system exception occurred
143            */
144            @SuppressWarnings("rawtypes")
145            public static java.util.List dynamicQuery(
146                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
147                    int end,
148                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
149                    throws com.liferay.portal.kernel.exception.SystemException {
150                    return getService()
151                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
152            }
153    
154            /**
155            * Returns the number of rows that match the dynamic query.
156            *
157            * @param dynamicQuery the dynamic query
158            * @return the number of rows that match the dynamic query
159            * @throws SystemException if a system exception occurred
160            */
161            public static long dynamicQueryCount(
162                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
163                    throws com.liferay.portal.kernel.exception.SystemException {
164                    return getService().dynamicQueryCount(dynamicQuery);
165            }
166    
167            public static com.liferay.portal.model.Permission fetchPermission(
168                    long permissionId)
169                    throws com.liferay.portal.kernel.exception.SystemException {
170                    return getService().fetchPermission(permissionId);
171            }
172    
173            /**
174            * Returns the permission with the primary key.
175            *
176            * @param permissionId the primary key of the permission
177            * @return the permission
178            * @throws PortalException if a permission with the primary key could not be found
179            * @throws SystemException if a system exception occurred
180            */
181            public static com.liferay.portal.model.Permission getPermission(
182                    long permissionId)
183                    throws com.liferay.portal.kernel.exception.PortalException,
184                            com.liferay.portal.kernel.exception.SystemException {
185                    return getService().getPermission(permissionId);
186            }
187    
188            public static com.liferay.portal.model.PersistedModel getPersistedModel(
189                    java.io.Serializable primaryKeyObj)
190                    throws com.liferay.portal.kernel.exception.PortalException,
191                            com.liferay.portal.kernel.exception.SystemException {
192                    return getService().getPersistedModel(primaryKeyObj);
193            }
194    
195            /**
196            * Returns a range of all the permissions.
197            *
198            * <p>
199            * 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.
200            * </p>
201            *
202            * @param start the lower bound of the range of permissions
203            * @param end the upper bound of the range of permissions (not inclusive)
204            * @return the range of permissions
205            * @throws SystemException if a system exception occurred
206            */
207            public static java.util.List<com.liferay.portal.model.Permission> getPermissions(
208                    int start, int end)
209                    throws com.liferay.portal.kernel.exception.SystemException {
210                    return getService().getPermissions(start, end);
211            }
212    
213            /**
214            * Returns the number of permissions.
215            *
216            * @return the number of permissions
217            * @throws SystemException if a system exception occurred
218            */
219            public static int getPermissionsCount()
220                    throws com.liferay.portal.kernel.exception.SystemException {
221                    return getService().getPermissionsCount();
222            }
223    
224            /**
225            * Updates the permission in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
226            *
227            * @param permission the permission
228            * @return the permission that was updated
229            * @throws SystemException if a system exception occurred
230            */
231            public static com.liferay.portal.model.Permission updatePermission(
232                    com.liferay.portal.model.Permission permission)
233                    throws com.liferay.portal.kernel.exception.SystemException {
234                    return getService().updatePermission(permission);
235            }
236    
237            /**
238            * Updates the permission in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
239            *
240            * @param permission the permission
241            * @param merge whether to merge the permission with the current session. See {@link com.liferay.portal.service.persistence.BatchSession#update(com.liferay.portal.kernel.dao.orm.Session, com.liferay.portal.model.BaseModel, boolean)} for an explanation.
242            * @return the permission that was updated
243            * @throws SystemException if a system exception occurred
244            */
245            public static com.liferay.portal.model.Permission updatePermission(
246                    com.liferay.portal.model.Permission permission, boolean merge)
247                    throws com.liferay.portal.kernel.exception.SystemException {
248                    return getService().updatePermission(permission, merge);
249            }
250    
251            /**
252            * Returns the Spring bean ID for this bean.
253            *
254            * @return the Spring bean ID for this bean
255            */
256            public static java.lang.String getBeanIdentifier() {
257                    return getService().getBeanIdentifier();
258            }
259    
260            /**
261            * Sets the Spring bean ID for this bean.
262            *
263            * @param beanIdentifier the Spring bean ID for this bean
264            */
265            public static void setBeanIdentifier(java.lang.String beanIdentifier) {
266                    getService().setBeanIdentifier(beanIdentifier);
267            }
268    
269            /**
270            * Adds a permission to perform the action on the resource.
271            *
272            * <p>
273            * This method will retrieve the permission of the company, action, and
274            * resource with the primary keys. The method creates the permission if it
275            * fails to retrieve it.
276            * </p>
277            *
278            * @param companyId the primary key of the company
279            * @param actionId the action's ID
280            * @param resourceId the primary key of the resource
281            * @return the permission of the company, action, and resource with the
282            primary keys
283            * @throws SystemException if a system exception occurred
284            */
285            public static com.liferay.portal.model.Permission addPermission(
286                    long companyId, java.lang.String actionId, long resourceId)
287                    throws com.liferay.portal.kernel.exception.SystemException {
288                    return getService().addPermission(companyId, actionId, resourceId);
289            }
290    
291            /**
292            * Adds permissions to perform the actions on the resource.
293            *
294            * <p>
295            * This method will retrieve the permissions of the company, actions, and
296            * resource with the primary keys. The method creates any permissions it
297            * fails to retrieve.
298            * </p>
299            *
300            * @param companyId the primary key of the company
301            * @param actionIds the primary keys of the actions
302            * @param resourceId the primary key of the resource
303            * @return the permissions to perform the actions on the resource
304            * @throws SystemException if a system exception occurred
305            */
306            public static java.util.List<com.liferay.portal.model.Permission> addPermissions(
307                    long companyId, java.util.List<java.lang.String> actionIds,
308                    long resourceId)
309                    throws com.liferay.portal.kernel.exception.SystemException {
310                    return getService().addPermissions(companyId, actionIds, resourceId);
311            }
312    
313            /**
314            * Adds permissions to perform either the portlet resource actions or model
315            * resource actions on the resource.
316            *
317            * <p>
318            * This method will retrieve the permissions of the company, actions, and
319            * resource with the primary keys. The method creates any permissions it
320            * fails to retrieve.
321            * </p>
322            *
323            * @param companyId the primary key of the company
324            * @param name the resource name
325            * @param resourceId the primary key of the resource
326            * @param portletActions whether to retrieve the action primary keys from
327            the portlet or the model resource
328            * @return the permissions to perform the actions on the resource
329            * @throws SystemException if a system exception occurred
330            */
331            public static java.util.List<com.liferay.portal.model.Permission> addPermissions(
332                    long companyId, java.lang.String name, long resourceId,
333                    boolean portletActions)
334                    throws com.liferay.portal.kernel.exception.SystemException {
335                    return getService()
336                                       .addPermissions(companyId, name, resourceId, portletActions);
337            }
338    
339            /**
340            * Adds user permissions to perform the actions on the resource.
341            *
342            * @param userId the primary key of the user
343            * @param actionIds the primary keys of the actions
344            * @param resourceId the primary key of the resource
345            * @throws PortalException if a user with the primary key could not be found
346            * @throws SystemException if a system exception occurred
347            */
348            public static void addUserPermissions(long userId,
349                    java.lang.String[] actionIds, long resourceId)
350                    throws com.liferay.portal.kernel.exception.PortalException,
351                            com.liferay.portal.kernel.exception.SystemException {
352                    getService().addUserPermissions(userId, actionIds, resourceId);
353            }
354    
355            /**
356            * Checks to see if the actions are permitted on the named resource.
357            *
358            * @param name the resource name
359            * @param actionIds the primary keys of the actions
360            * @throws PortalException if the resource company or name could not be
361            found or were invalid
362            * @throws SystemException if a system exception occurred
363            */
364            public static void checkPermissions(java.lang.String name,
365                    java.util.List<java.lang.String> actionIds)
366                    throws com.liferay.portal.kernel.exception.PortalException,
367                            com.liferay.portal.kernel.exception.SystemException {
368                    getService().checkPermissions(name, actionIds);
369            }
370    
371            /**
372            * Returns the IDs of all the actions belonging to the permissions.
373            *
374            * @param permissions the permissions
375            * @return the IDs of all the actions belonging to the permissions
376            */
377            public static java.util.List<java.lang.String> getActions(
378                    java.util.List<com.liferay.portal.model.Permission> permissions) {
379                    return getService().getActions(permissions);
380            }
381    
382            /**
383            * Returns all the group's permissions on the resource.
384            *
385            * @param groupId the primary key of the group
386            * @param resourceId the primary key of the resource
387            * @return the group's permissions on the resource
388            * @throws SystemException if a system exception occurred
389            */
390            public static java.util.List<com.liferay.portal.model.Permission> getGroupPermissions(
391                    long groupId, long resourceId)
392                    throws com.liferay.portal.kernel.exception.SystemException {
393                    return getService().getGroupPermissions(groupId, resourceId);
394            }
395    
396            /**
397            * Returns all the group's permissions on the named resource with the scope
398            * and primKey.
399            *
400            * @param groupId the primary key of the group
401            * @param companyId the primary key of the company
402            * @param name the resource name
403            * @param scope the resource scope
404            * @param primKey the resource primKey
405            * @return the group's permissions on the named resource with the scope and
406            primKey
407            * @throws SystemException if a system exception occurred
408            */
409            public static java.util.List<com.liferay.portal.model.Permission> getGroupPermissions(
410                    long groupId, long companyId, java.lang.String name, int scope,
411                    java.lang.String primKey)
412                    throws com.liferay.portal.kernel.exception.SystemException {
413                    return getService()
414                                       .getGroupPermissions(groupId, companyId, name, scope, primKey);
415            }
416    
417            /**
418            * Returns the primary key of the latest permission created.
419            *
420            * @return the primary key of the latest permission created
421            * @throws SystemException if a system exception occurred
422            */
423            public static long getLatestPermissionId()
424                    throws com.liferay.portal.kernel.exception.SystemException {
425                    return getService().getLatestPermissionId();
426            }
427    
428            /**
429            * Returns all the permissions of the organization's group with respect to
430            * the resource.
431            *
432            * @param organizationId the primary key of the organization
433            * @param groupId the primary key of the group
434            * @param resourceId the primary key of the resource
435            * @return the permissions of the organization's group with respect to the
436            resource
437            * @throws SystemException if a system exception occurred
438            */
439            public static java.util.List<com.liferay.portal.model.Permission> getOrgGroupPermissions(
440                    long organizationId, long groupId, long resourceId)
441                    throws com.liferay.portal.kernel.exception.SystemException {
442                    return getService()
443                                       .getOrgGroupPermissions(organizationId, groupId, resourceId);
444            }
445    
446            /**
447            * Returns all the permissions to perform the actions on the resource,
448            * creating new permissions for any permissions not found.
449            *
450            * @param companyId the primary key of the company
451            * @param actionIds the primary keys of the actions
452            * @param resourceId the primary key of the resource
453            * @return the permissions to perform the actions on the resource
454            * @throws SystemException if a system exception occurred
455            * @see #addPermission(long, String, long)
456            */
457            public static java.util.List<com.liferay.portal.model.Permission> getPermissions(
458                    long companyId, java.lang.String[] actionIds, long resourceId)
459                    throws com.liferay.portal.kernel.exception.SystemException {
460                    return getService().getPermissions(companyId, actionIds, resourceId);
461            }
462    
463            /**
464            * Returns all the role's permissions.
465            *
466            * @param roleId the primary key of the role
467            * @return the role's permissions
468            * @throws SystemException if a system exception occurred
469            */
470            public static java.util.List<com.liferay.portal.model.Permission> getRolePermissions(
471                    long roleId) throws com.liferay.portal.kernel.exception.SystemException {
472                    return getService().getRolePermissions(roleId);
473            }
474    
475            public static java.util.List<com.liferay.portal.model.Permission> getRolePermissions(
476                    long roleId, int[] scopes)
477                    throws com.liferay.portal.kernel.exception.SystemException {
478                    return getService().getRolePermissions(roleId, scopes);
479            }
480    
481            /**
482            * Returns all the role's permissions on the resource.
483            *
484            * @param roleId the primary key of the role
485            * @param resourceId the primary key of the resource
486            * @return the role's permissions on the resource
487            * @throws SystemException if a system exception occurred
488            */
489            public static java.util.List<com.liferay.portal.model.Permission> getRolePermissions(
490                    long roleId, long resourceId)
491                    throws com.liferay.portal.kernel.exception.SystemException {
492                    return getService().getRolePermissions(roleId, resourceId);
493            }
494    
495            /**
496            * Returns all the user's permissions.
497            *
498            * @param userId the primary key of the user
499            * @return the user's permissions
500            * @throws SystemException if a system exception occurred
501            */
502            public static java.util.List<com.liferay.portal.model.Permission> getUserPermissions(
503                    long userId) throws com.liferay.portal.kernel.exception.SystemException {
504                    return getService().getUserPermissions(userId);
505            }
506    
507            /**
508            * Returns all the user's permissions on the resource.
509            *
510            * @param userId the primary key of the user
511            * @param resourceId the primary key of the resource
512            * @return the user's permissions on the resource
513            * @throws SystemException if a system exception occurred
514            */
515            public static java.util.List<com.liferay.portal.model.Permission> getUserPermissions(
516                    long userId, long resourceId)
517                    throws com.liferay.portal.kernel.exception.SystemException {
518                    return getService().getUserPermissions(userId, resourceId);
519            }
520    
521            /**
522            * Returns all the user's permissions on the named resource with the scope
523            * and primKey.
524            *
525            * @param userId the primary key of the user
526            * @param companyId the primary key of the company
527            * @param name the resource name
528            * @param scope the resource scope
529            * @param primKey the resource primKey
530            * @return the user permissions of the resource name, scope, and primKey
531            * @throws SystemException if a system exception occurred
532            */
533            public static java.util.List<com.liferay.portal.model.Permission> getUserPermissions(
534                    long userId, long companyId, java.lang.String name, int scope,
535                    java.lang.String primKey)
536                    throws com.liferay.portal.kernel.exception.SystemException {
537                    return getService()
538                                       .getUserPermissions(userId, companyId, name, scope, primKey);
539            }
540    
541            /**
542            * Returns <code>true</code> if the group has permission to perform the
543            * action on the resource.
544            *
545            * @param groupId the primary key of the group
546            * @param actionId the action's ID
547            * @param resourceId the primary key of the resource
548            * @return <code>true</code> if the group has permission to perform the
549            action on the resource; <code>false</code> otherwise
550            * @throws SystemException if a system exception occurred
551            */
552            public static boolean hasGroupPermission(long groupId,
553                    java.lang.String actionId, long resourceId)
554                    throws com.liferay.portal.kernel.exception.SystemException {
555                    return getService().hasGroupPermission(groupId, actionId, resourceId);
556            }
557    
558            /**
559            * Returns <code>true</code> if the role has permission to perform the
560            * action on the named resource with the scope.
561            *
562            * @param roleId the primary key of the role
563            * @param companyId the primary key of the company
564            * @param name the resource name
565            * @param scope the resource scope
566            * @param actionId the action's ID
567            * @return <code>true</code> if the role has permission to perform the
568            action on the named resource with the scope; <code>false</code>
569            otherwise
570            * @throws SystemException if a system exception occurred
571            */
572            public static boolean hasRolePermission(long roleId, long companyId,
573                    java.lang.String name, int scope, java.lang.String actionId)
574                    throws com.liferay.portal.kernel.exception.SystemException {
575                    return getService()
576                                       .hasRolePermission(roleId, companyId, name, scope, actionId);
577            }
578    
579            /**
580            * Returns <code>true</code> if the role has permission to perform the
581            * action on the named resource with the scope and primKey.
582            *
583            * @param roleId the primary key of the role
584            * @param companyId the primary key of the company
585            * @param name the resource name
586            * @param scope the resource scope
587            * @param primKey the resource primKey
588            * @param actionId the action's ID
589            * @return <code>true</code> if the role has permission to perform the
590            action on the named resource with the scope and primKey;
591            <code>false</code> otherwise
592            * @throws SystemException if a system exception occurred
593            */
594            public static boolean hasRolePermission(long roleId, long companyId,
595                    java.lang.String name, int scope, java.lang.String primKey,
596                    java.lang.String actionId)
597                    throws com.liferay.portal.kernel.exception.SystemException {
598                    return getService()
599                                       .hasRolePermission(roleId, companyId, name, scope, primKey,
600                            actionId);
601            }
602    
603            /**
604            * Returns <code>true</code> if the user has permission to perform the
605            * action on the resource.
606            *
607            * @param userId the primary key of the user
608            * @param actionId the action's ID
609            * @param resourceId the primary key of the resource
610            * @return <code>true</code> if the user has permission to perform the
611            action on the resource; <code>false</code> otherwise
612            * @throws SystemException if a system exception occurred
613            */
614            public static boolean hasUserPermission(long userId,
615                    java.lang.String actionId, long resourceId)
616                    throws com.liferay.portal.kernel.exception.SystemException {
617                    return getService().hasUserPermission(userId, actionId, resourceId);
618            }
619    
620            /**
621            * Returns <code>true</code> if the user has permission to perform the
622            * action on the resources.
623            *
624            * <p>
625            * This method does not support resources managed by the resource block
626            * system.
627            * </p>
628            *
629            * @param userId the primary key of the user
630            * @param groupId the primary key of the group containing the resource
631            * @param resources representations of the resource at each scope level
632            returned by {@link
633            com.liferay.portal.security.permission.AdvancedPermissionChecker#getResources(
634            long, long, String, String, String)}
635            * @param actionId the action's ID
636            * @param permissionCheckerBag the permission checker bag
637            * @return <code>true</code> if the user has permission to perform the
638            action on the resources; <code>false</code> otherwise
639            * @throws PortalException if a resource action based on any one of the
640            resources and the action ID could not be found
641            * @throws SystemException if a system exception occurred
642            */
643            public static boolean hasUserPermissions(long userId, long groupId,
644                    java.util.List<com.liferay.portal.model.Resource> resources,
645                    java.lang.String actionId,
646                    com.liferay.portal.security.permission.PermissionCheckerBag permissionCheckerBag)
647                    throws com.liferay.portal.kernel.exception.PortalException,
648                            com.liferay.portal.kernel.exception.SystemException {
649                    return getService()
650                                       .hasUserPermissions(userId, groupId, resources, actionId,
651                            permissionCheckerBag);
652            }
653    
654            /**
655            * Sets the container wide permissions of either the role or the default
656            * user of each company to perform the actions on the named resource.
657            *
658            * @param name the resource name
659            * @param roleName the role name. Supported role names include {@link
660            com.liferay.portal.model.RoleConstants#ORGANIZATION_USER}, {@link
661            com.liferay.portal.model.RoleConstants#OWNER}, and {@link
662            com.liferay.portal.model.RoleConstants#SITE_MEMBER}.
663            * @param actionId the action's ID
664            * @throws PortalException if a matching role could not be found or if a
665            default user for the company could not be found
666            * @throws SystemException if a system exception occurred
667            */
668            public static void setContainerResourcePermissions(java.lang.String name,
669                    java.lang.String roleName, java.lang.String actionId)
670                    throws com.liferay.portal.kernel.exception.PortalException,
671                            com.liferay.portal.kernel.exception.SystemException {
672                    getService().setContainerResourcePermissions(name, roleName, actionId);
673            }
674    
675            /**
676            * Sets the group's permissions to perform the actions on the resource,
677            * replacing the group's existing permissions on the resource.
678            *
679            * @param groupId the primary key of the group
680            * @param actionIds the primary keys of the actions
681            * @param resourceId the primary key of the resource
682            * @throws PortalException if a group with the primary key could not be
683            found
684            * @throws SystemException if a system exception occurred
685            */
686            public static void setGroupPermissions(long groupId,
687                    java.lang.String[] actionIds, long resourceId)
688                    throws com.liferay.portal.kernel.exception.PortalException,
689                            com.liferay.portal.kernel.exception.SystemException {
690                    getService().setGroupPermissions(groupId, actionIds, resourceId);
691            }
692    
693            /**
694            * Sets the entity's group permissions to perform the actions on the
695            * resource, replacing the entity's existing group permissions on the
696            * resource. Only {@link com.liferay.portal.model.Organization} and {@link
697            * com.liferay.portal.model.UserGroup} class entities are supported.
698            *
699            * @param className the class name of an organization or user group
700            * @param classPK the primary key of the class
701            * @param groupId the primary key of the group
702            * @param actionIds the primary keys of the actions
703            * @param resourceId the primary key of the resource
704            * @throws PortalException if an entity with the class name and primary key
705            could not be found or if the entity's associated group could not
706            be found
707            * @throws SystemException if a system exception occurred
708            */
709            public static void setGroupPermissions(java.lang.String className,
710                    java.lang.String classPK, long groupId, java.lang.String[] actionIds,
711                    long resourceId)
712                    throws com.liferay.portal.kernel.exception.PortalException,
713                            com.liferay.portal.kernel.exception.SystemException {
714                    getService()
715                            .setGroupPermissions(className, classPK, groupId, actionIds,
716                            resourceId);
717            }
718    
719            /**
720            * Sets the organization's group permissions to perform the actions on the
721            * resource, replacing the organization's existing group permissions on the
722            * resource.
723            *
724            * @param organizationId the primary key of the organization
725            * @param groupId the primary key of the group in which to scope the
726            permissions
727            * @param actionIds the primary keys of the actions
728            * @param resourceId the primary key of the resource
729            * @throws PortalException if an organization with the primary key could not
730            be found
731            * @throws SystemException if a system exception occurred
732            */
733            public static void setOrgGroupPermissions(long organizationId,
734                    long groupId, java.lang.String[] actionIds, long resourceId)
735                    throws com.liferay.portal.kernel.exception.PortalException,
736                            com.liferay.portal.kernel.exception.SystemException {
737                    getService()
738                            .setOrgGroupPermissions(organizationId, groupId, actionIds,
739                            resourceId);
740            }
741    
742            /**
743            * Sets the role's permissions to perform the action on the named resource,
744            * replacing the role's existing permissions on the resource.
745            *
746            * @param roleId the primary key of the role
747            * @param companyId the primary key of the company
748            * @param name the resource name
749            * @param scope the resource scope
750            * @param primKey the resource primKey
751            * @param actionId the action's ID
752            * @throws PortalException if the scope was {@link
753            com.liferay.portal.model.ResourceConstants#SCOPE_INDIVIDUAL}
754            * @throws SystemException if a system exception occurred
755            */
756            public static void setRolePermission(long roleId, long companyId,
757                    java.lang.String name, int scope, java.lang.String primKey,
758                    java.lang.String actionId)
759                    throws com.liferay.portal.kernel.exception.PortalException,
760                            com.liferay.portal.kernel.exception.SystemException {
761                    getService()
762                            .setRolePermission(roleId, companyId, name, scope, primKey, actionId);
763            }
764    
765            /**
766            * Sets the role's permissions to perform the actions on the named resource,
767            * replacing the role's existing permission for each of these actions on the
768            * resource.
769            *
770            * @param roleId the primary key of the role
771            * @param companyId the primary key of the company
772            * @param name the resource name
773            * @param scope the resource scope
774            * @param primKey the resource primKey
775            * @param actionIds the primary keys of the actions
776            * @throws PortalException if the scope was {@link
777            com.liferay.portal.model.ResourceConstants#SCOPE_INDIVIDUAL}
778            * @throws SystemException if a system exception occurred
779            */
780            public static void setRolePermissions(long roleId, long companyId,
781                    java.lang.String name, int scope, java.lang.String primKey,
782                    java.lang.String[] actionIds)
783                    throws com.liferay.portal.kernel.exception.PortalException,
784                            com.liferay.portal.kernel.exception.SystemException {
785                    getService()
786                            .setRolePermissions(roleId, companyId, name, scope, primKey,
787                            actionIds);
788            }
789    
790            /**
791            * Sets the role's permissions to perform the actions on the resource,
792            * replacing the role's existing permissions on the resource.
793            *
794            * @param roleId the primary key of the role
795            * @param actionIds the primary keys of the actions
796            * @param resourceId the primary key of the resource
797            * @throws PortalException if a role with the primary key could not be found
798            * @throws SystemException if a system exception occurred
799            */
800            public static void setRolePermissions(long roleId,
801                    java.lang.String[] actionIds, long resourceId)
802                    throws com.liferay.portal.kernel.exception.PortalException,
803                            com.liferay.portal.kernel.exception.SystemException {
804                    getService().setRolePermissions(roleId, actionIds, resourceId);
805            }
806    
807            /**
808            * Sets the permissions of each role to perform respective actions on the
809            * resource, replacing the existing permissions of each role on the
810            * resource.
811            *
812            * @param companyId the primary key of the company
813            * @param roleIdsToActionIds the map of roles to their new actions on the
814            resource
815            * @param resourceId the primary key of the resource
816            * @throws SystemException if a system exception occurred
817            */
818            public static void setRolesPermissions(long companyId,
819                    java.util.Map<java.lang.Long, java.lang.String[]> roleIdsToActionIds,
820                    long resourceId)
821                    throws com.liferay.portal.kernel.exception.SystemException {
822                    getService()
823                            .setRolesPermissions(companyId, roleIdsToActionIds, resourceId);
824            }
825    
826            /**
827            * Sets the permissions of each role to perform respective actions on the
828            * named resource, replacing the existing permissions of each role on the
829            * resource.
830            *
831            * @param companyId the primary key of the company
832            * @param roleIdsToActionIds the map of roles to their new actions on the
833            resource
834            * @param name the resource name
835            * @param scope the resource scope
836            * @param primKey the resource primKey
837            * @throws SystemException if a system exception occurred
838            */
839            public static void setRolesPermissions(long companyId,
840                    java.util.Map<java.lang.Long, java.lang.String[]> roleIdsToActionIds,
841                    java.lang.String name, int scope, java.lang.String primKey)
842                    throws com.liferay.portal.kernel.exception.SystemException {
843                    getService()
844                            .setRolesPermissions(companyId, roleIdsToActionIds, name, scope,
845                            primKey);
846            }
847    
848            /**
849            * Sets the user's permissions to perform the actions on the resource,
850            * replacing the user's existing permissions on the resource.
851            *
852            * @param userId the primary key of the user
853            * @param actionIds the primary keys of the actions
854            * @param resourceId the primary key of the resource
855            * @throws PortalException if a user with the primary key could not be found
856            * @throws SystemException if a system exception occurred
857            */
858            public static void setUserPermissions(long userId,
859                    java.lang.String[] actionIds, long resourceId)
860                    throws com.liferay.portal.kernel.exception.PortalException,
861                            com.liferay.portal.kernel.exception.SystemException {
862                    getService().setUserPermissions(userId, actionIds, resourceId);
863            }
864    
865            /**
866            * Removes the permission from the role.
867            *
868            * @param roleId the primary key of the role
869            * @param permissionId the primary key of the permission
870            * @throws SystemException if a system exception occurred
871            */
872            public static void unsetRolePermission(long roleId, long permissionId)
873                    throws com.liferay.portal.kernel.exception.SystemException {
874                    getService().unsetRolePermission(roleId, permissionId);
875            }
876    
877            /**
878            * Removes the role's permissions to perform the action on the named
879            * resource with the scope and primKey.
880            *
881            * @param roleId the primary key of the role
882            * @param companyId the primary key of the company
883            * @param name the resource name
884            * @param scope the resource scope
885            * @param primKey the resource primKey
886            * @param actionId the action's ID
887            * @throws SystemException if a system exception occurred
888            */
889            public static void unsetRolePermission(long roleId, long companyId,
890                    java.lang.String name, int scope, java.lang.String primKey,
891                    java.lang.String actionId)
892                    throws com.liferay.portal.kernel.exception.SystemException {
893                    getService()
894                            .unsetRolePermission(roleId, companyId, name, scope, primKey,
895                            actionId);
896            }
897    
898            /**
899            * Removes the role's permissions to perform the action on the named
900            * resource.
901            *
902            * @param roleId the primary key of the role
903            * @param companyId the primary key of the company
904            * @param name the resource name
905            * @param scope the resource scope
906            * @param actionId the action's ID
907            * @throws SystemException if a system exception occurred
908            */
909            public static void unsetRolePermissions(long roleId, long companyId,
910                    java.lang.String name, int scope, java.lang.String actionId)
911                    throws com.liferay.portal.kernel.exception.SystemException {
912                    getService()
913                            .unsetRolePermissions(roleId, companyId, name, scope, actionId);
914            }
915    
916            /**
917            * Removes the user's permissions to perform the actions on the resource.
918            *
919            * @param userId the primary key of the user
920            * @param actionIds the primary keys of the actions
921            * @param resourceId the primary key of the resource
922            * @throws SystemException if a system exception occurred
923            */
924            public static void unsetUserPermissions(long userId,
925                    java.lang.String[] actionIds, long resourceId)
926                    throws com.liferay.portal.kernel.exception.SystemException {
927                    getService().unsetUserPermissions(userId, actionIds, resourceId);
928            }
929    
930            public static PermissionLocalService getService() {
931                    if (_service == null) {
932                            _service = (PermissionLocalService)PortalBeanLocatorUtil.locate(PermissionLocalService.class.getName());
933    
934                            ReferenceRegistry.registerReference(PermissionLocalServiceUtil.class,
935                                    "_service");
936                    }
937    
938                    return _service;
939            }
940    
941            /**
942             * @deprecated
943             */
944            public void setService(PermissionLocalService service) {
945            }
946    
947            private static PermissionLocalService _service;
948    }