001    /**
002     * Copyright (c) 2000-2010 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    
019    /**
020     * The utility for the permission remote service. This utility wraps {@link com.liferay.portal.service.impl.PermissionServiceImpl} and is the primary access point for service operations in application layer code running on a remote server.
021     *
022     * <p>
023     * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.PermissionServiceImpl} and rerun ServiceBuilder to regenerate this class.
024     * </p>
025     *
026     * <p>
027     * 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.
028     * </p>
029     *
030     * @author Brian Wing Shun Chan
031     * @see PermissionService
032     * @see com.liferay.portal.service.base.PermissionServiceBaseImpl
033     * @see com.liferay.portal.service.impl.PermissionServiceImpl
034     * @generated
035     */
036    public class PermissionServiceUtil {
037            public static void checkPermission(long groupId, long resourceId)
038                    throws com.liferay.portal.kernel.exception.PortalException,
039                            com.liferay.portal.kernel.exception.SystemException {
040                    getService().checkPermission(groupId, resourceId);
041            }
042    
043            public static void checkPermission(long groupId, java.lang.String name,
044                    long primKey)
045                    throws com.liferay.portal.kernel.exception.PortalException,
046                            com.liferay.portal.kernel.exception.SystemException {
047                    getService().checkPermission(groupId, name, primKey);
048            }
049    
050            public static void checkPermission(long groupId, java.lang.String name,
051                    java.lang.String primKey)
052                    throws com.liferay.portal.kernel.exception.PortalException,
053                            com.liferay.portal.kernel.exception.SystemException {
054                    getService().checkPermission(groupId, name, primKey);
055            }
056    
057            public static boolean hasGroupPermission(long groupId,
058                    java.lang.String actionId, long resourceId)
059                    throws com.liferay.portal.kernel.exception.SystemException {
060                    return getService().hasGroupPermission(groupId, actionId, resourceId);
061            }
062    
063            public static boolean hasUserPermission(long userId,
064                    java.lang.String actionId, long resourceId)
065                    throws com.liferay.portal.kernel.exception.SystemException {
066                    return getService().hasUserPermission(userId, actionId, resourceId);
067            }
068    
069            public static boolean hasUserPermissions(long userId, long groupId,
070                    java.util.List<com.liferay.portal.model.Resource> resources,
071                    java.lang.String actionId,
072                    com.liferay.portal.security.permission.PermissionCheckerBag permissionCheckerBag)
073                    throws com.liferay.portal.kernel.exception.PortalException,
074                            com.liferay.portal.kernel.exception.SystemException {
075                    return getService()
076                                       .hasUserPermissions(userId, groupId, resources, actionId,
077                            permissionCheckerBag);
078            }
079    
080            public static void setGroupPermissions(long groupId,
081                    java.lang.String[] actionIds, long resourceId)
082                    throws com.liferay.portal.kernel.exception.PortalException,
083                            com.liferay.portal.kernel.exception.SystemException {
084                    getService().setGroupPermissions(groupId, actionIds, resourceId);
085            }
086    
087            public static void setGroupPermissions(java.lang.String className,
088                    java.lang.String classPK, long groupId, java.lang.String[] actionIds,
089                    long resourceId)
090                    throws com.liferay.portal.kernel.exception.PortalException,
091                            com.liferay.portal.kernel.exception.SystemException {
092                    getService()
093                            .setGroupPermissions(className, classPK, groupId, actionIds,
094                            resourceId);
095            }
096    
097            public static void setOrgGroupPermissions(long organizationId,
098                    long groupId, java.lang.String[] actionIds, long resourceId)
099                    throws com.liferay.portal.kernel.exception.PortalException,
100                            com.liferay.portal.kernel.exception.SystemException {
101                    getService()
102                            .setOrgGroupPermissions(organizationId, groupId, actionIds,
103                            resourceId);
104            }
105    
106            public static void setRolePermission(long roleId, long groupId,
107                    java.lang.String name, int scope, java.lang.String primKey,
108                    java.lang.String actionId)
109                    throws com.liferay.portal.kernel.exception.PortalException,
110                            com.liferay.portal.kernel.exception.SystemException {
111                    getService()
112                            .setRolePermission(roleId, groupId, name, scope, primKey, actionId);
113            }
114    
115            public static void setRolePermissions(long roleId, long groupId,
116                    java.lang.String[] actionIds, long resourceId)
117                    throws com.liferay.portal.kernel.exception.PortalException,
118                            com.liferay.portal.kernel.exception.SystemException {
119                    getService().setRolePermissions(roleId, groupId, actionIds, resourceId);
120            }
121    
122            public static void setUserPermissions(long userId, long groupId,
123                    java.lang.String[] actionIds, long resourceId)
124                    throws com.liferay.portal.kernel.exception.PortalException,
125                            com.liferay.portal.kernel.exception.SystemException {
126                    getService().setUserPermissions(userId, groupId, actionIds, resourceId);
127            }
128    
129            public static void unsetRolePermission(long roleId, long groupId,
130                    long permissionId)
131                    throws com.liferay.portal.kernel.exception.PortalException,
132                            com.liferay.portal.kernel.exception.SystemException {
133                    getService().unsetRolePermission(roleId, groupId, permissionId);
134            }
135    
136            public static void unsetRolePermission(long roleId, long groupId,
137                    java.lang.String name, int scope, java.lang.String primKey,
138                    java.lang.String actionId)
139                    throws com.liferay.portal.kernel.exception.PortalException,
140                            com.liferay.portal.kernel.exception.SystemException {
141                    getService()
142                            .unsetRolePermission(roleId, groupId, name, scope, primKey, actionId);
143            }
144    
145            public static void unsetRolePermissions(long roleId, long groupId,
146                    java.lang.String name, int scope, java.lang.String actionId)
147                    throws com.liferay.portal.kernel.exception.PortalException,
148                            com.liferay.portal.kernel.exception.SystemException {
149                    getService().unsetRolePermissions(roleId, groupId, name, scope, actionId);
150            }
151    
152            public static void unsetUserPermissions(long userId, long groupId,
153                    java.lang.String[] actionIds, long resourceId)
154                    throws com.liferay.portal.kernel.exception.PortalException,
155                            com.liferay.portal.kernel.exception.SystemException {
156                    getService().unsetUserPermissions(userId, groupId, actionIds, resourceId);
157            }
158    
159            public static PermissionService getService() {
160                    if (_service == null) {
161                            _service = (PermissionService)PortalBeanLocatorUtil.locate(PermissionService.class.getName());
162                    }
163    
164                    return _service;
165            }
166    
167            public void setService(PermissionService service) {
168                    _service = service;
169            }
170    
171            private static PermissionService _service;
172    }