001
014
015 package com.liferay.portal.service;
016
017 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018
019
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 }