001    /**
002     * Copyright (c) 2000-2010 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 com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    
019    /**
020     * The utility for the role remote service. This utility wraps {@link com.liferay.portal.service.impl.RoleServiceImpl} 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.RoleServiceImpl} 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 RoleService
032     * @see com.liferay.portal.service.base.RoleServiceBaseImpl
033     * @see com.liferay.portal.service.impl.RoleServiceImpl
034     * @generated
035     */
036    public class RoleServiceUtil {
037            public static com.liferay.portal.model.Role addRole(java.lang.String name,
038                    java.util.Map<java.util.Locale, java.lang.String> titleMap,
039                    java.lang.String description, int type)
040                    throws com.liferay.portal.kernel.exception.PortalException,
041                            com.liferay.portal.kernel.exception.SystemException {
042                    return getService().addRole(name, titleMap, description, type);
043            }
044    
045            public static void addUserRoles(long userId, long[] roleIds)
046                    throws com.liferay.portal.kernel.exception.PortalException,
047                            com.liferay.portal.kernel.exception.SystemException {
048                    getService().addUserRoles(userId, roleIds);
049            }
050    
051            public static void deleteRole(long roleId)
052                    throws com.liferay.portal.kernel.exception.PortalException,
053                            com.liferay.portal.kernel.exception.SystemException {
054                    getService().deleteRole(roleId);
055            }
056    
057            public static java.util.List<com.liferay.portal.model.Role> getGroupRoles(
058                    long groupId)
059                    throws com.liferay.portal.kernel.exception.SystemException {
060                    return getService().getGroupRoles(groupId);
061            }
062    
063            public static com.liferay.portal.model.Role getRole(long roleId)
064                    throws com.liferay.portal.kernel.exception.PortalException,
065                            com.liferay.portal.kernel.exception.SystemException {
066                    return getService().getRole(roleId);
067            }
068    
069            public static com.liferay.portal.model.Role getRole(long companyId,
070                    java.lang.String name)
071                    throws com.liferay.portal.kernel.exception.PortalException,
072                            com.liferay.portal.kernel.exception.SystemException {
073                    return getService().getRole(companyId, name);
074            }
075    
076            public static java.util.List<com.liferay.portal.model.Role> getUserGroupGroupRoles(
077                    long userId, long groupId)
078                    throws com.liferay.portal.kernel.exception.SystemException {
079                    return getService().getUserGroupGroupRoles(userId, groupId);
080            }
081    
082            public static java.util.List<com.liferay.portal.model.Role> getUserGroupRoles(
083                    long userId, long groupId)
084                    throws com.liferay.portal.kernel.exception.SystemException {
085                    return getService().getUserGroupRoles(userId, groupId);
086            }
087    
088            public static java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles(
089                    long userId, java.util.List<com.liferay.portal.model.Group> groups)
090                    throws com.liferay.portal.kernel.exception.SystemException {
091                    return getService().getUserRelatedRoles(userId, groups);
092            }
093    
094            public static java.util.List<com.liferay.portal.model.Role> getUserRoles(
095                    long userId) throws com.liferay.portal.kernel.exception.SystemException {
096                    return getService().getUserRoles(userId);
097            }
098    
099            public static boolean hasUserRole(long userId, long companyId,
100                    java.lang.String name, boolean inherited)
101                    throws com.liferay.portal.kernel.exception.PortalException,
102                            com.liferay.portal.kernel.exception.SystemException {
103                    return getService().hasUserRole(userId, companyId, name, inherited);
104            }
105    
106            public static boolean hasUserRoles(long userId, long companyId,
107                    java.lang.String[] names, boolean inherited)
108                    throws com.liferay.portal.kernel.exception.PortalException,
109                            com.liferay.portal.kernel.exception.SystemException {
110                    return getService().hasUserRoles(userId, companyId, names, inherited);
111            }
112    
113            public static void unsetUserRoles(long userId, long[] roleIds)
114                    throws com.liferay.portal.kernel.exception.PortalException,
115                            com.liferay.portal.kernel.exception.SystemException {
116                    getService().unsetUserRoles(userId, roleIds);
117            }
118    
119            public static com.liferay.portal.model.Role updateRole(long roleId,
120                    java.lang.String name,
121                    java.util.Map<java.util.Locale, java.lang.String> titleMap,
122                    java.lang.String description, java.lang.String subtype)
123                    throws com.liferay.portal.kernel.exception.PortalException,
124                            com.liferay.portal.kernel.exception.SystemException {
125                    return getService()
126                                       .updateRole(roleId, name, titleMap, description, subtype);
127            }
128    
129            public static RoleService getService() {
130                    if (_service == null) {
131                            _service = (RoleService)PortalBeanLocatorUtil.locate(RoleService.class.getName());
132                    }
133    
134                    return _service;
135            }
136    
137            public void setService(RoleService service) {
138                    _service = service;
139            }
140    
141            private static RoleService _service;
142    }