001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.service;
016    
017    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    import com.liferay.portal.kernel.util.MethodCache;
019    import com.liferay.portal.kernel.util.ReferenceRegistry;
020    
021    /**
022     * The utility for the resource permission remote service. This utility wraps {@link com.liferay.portal.service.impl.ResourcePermissionServiceImpl} and is the primary access point for service operations in application layer code running on a remote server.
023     *
024     * <p>
025     * This is a remote service. Methods of this service are expected to have security checks based on the propagated JAAS credentials because this service can be accessed remotely.
026     * </p>
027     *
028     * @author Brian Wing Shun Chan
029     * @see ResourcePermissionService
030     * @see com.liferay.portal.service.base.ResourcePermissionServiceBaseImpl
031     * @see com.liferay.portal.service.impl.ResourcePermissionServiceImpl
032     * @generated
033     */
034    public class ResourcePermissionServiceUtil {
035            /*
036             * NOTE FOR DEVELOPERS:
037             *
038             * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.ResourcePermissionServiceImpl} and rerun ServiceBuilder to regenerate this class.
039             */
040            public static void addResourcePermission(long groupId, long companyId,
041                    java.lang.String name, int scope, java.lang.String primKey,
042                    long roleId, java.lang.String actionId)
043                    throws com.liferay.portal.kernel.exception.PortalException,
044                            com.liferay.portal.kernel.exception.SystemException {
045                    getService()
046                            .addResourcePermission(groupId, companyId, name, scope, primKey,
047                            roleId, actionId);
048            }
049    
050            public static void setIndividualResourcePermissions(long groupId,
051                    long companyId, java.lang.String name, java.lang.String primKey,
052                    long roleId, java.lang.String[] actionIds)
053                    throws com.liferay.portal.kernel.exception.PortalException,
054                            com.liferay.portal.kernel.exception.SystemException {
055                    getService()
056                            .setIndividualResourcePermissions(groupId, companyId, name,
057                            primKey, roleId, actionIds);
058            }
059    
060            public static void removeResourcePermission(long groupId, long companyId,
061                    java.lang.String name, int scope, java.lang.String primKey,
062                    long roleId, java.lang.String actionId)
063                    throws com.liferay.portal.kernel.exception.PortalException,
064                            com.liferay.portal.kernel.exception.SystemException {
065                    getService()
066                            .removeResourcePermission(groupId, companyId, name, scope, primKey,
067                            roleId, actionId);
068            }
069    
070            public static void removeResourcePermissions(long groupId, long companyId,
071                    java.lang.String name, int scope, long roleId, java.lang.String actionId)
072                    throws com.liferay.portal.kernel.exception.PortalException,
073                            com.liferay.portal.kernel.exception.SystemException {
074                    getService()
075                            .removeResourcePermissions(groupId, companyId, name, scope, roleId,
076                            actionId);
077            }
078    
079            public static ResourcePermissionService getService() {
080                    if (_service == null) {
081                            _service = (ResourcePermissionService)PortalBeanLocatorUtil.locate(ResourcePermissionService.class.getName());
082    
083                            ReferenceRegistry.registerReference(ResourcePermissionServiceUtil.class,
084                                    "_service");
085                            MethodCache.remove(ResourcePermissionService.class);
086                    }
087    
088                    return _service;
089            }
090    
091            public void setService(ResourcePermissionService service) {
092                    MethodCache.remove(ResourcePermissionService.class);
093    
094                    _service = service;
095    
096                    ReferenceRegistry.registerReference(ResourcePermissionServiceUtil.class,
097                            "_service");
098                    MethodCache.remove(ResourcePermissionService.class);
099            }
100    
101            private static ResourcePermissionService _service;
102    }