1
14
15 package com.liferay.portal.service;
16
17 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
18
19
39 public class RoleServiceUtil {
40 public static com.liferay.portal.model.Role addRole(java.lang.String name,
41 java.util.Map<java.util.Locale, java.lang.String> titleMap,
42 java.lang.String description, int type)
43 throws com.liferay.portal.kernel.exception.PortalException,
44 com.liferay.portal.kernel.exception.SystemException {
45 return getService().addRole(name, titleMap, description, type);
46 }
47
48 public static void addUserRoles(long userId, long[] roleIds)
49 throws com.liferay.portal.kernel.exception.PortalException,
50 com.liferay.portal.kernel.exception.SystemException {
51 getService().addUserRoles(userId, roleIds);
52 }
53
54 public static void deleteRole(long roleId)
55 throws com.liferay.portal.kernel.exception.PortalException,
56 com.liferay.portal.kernel.exception.SystemException {
57 getService().deleteRole(roleId);
58 }
59
60 public static java.util.List<com.liferay.portal.model.Role> getGroupRoles(
61 long groupId)
62 throws com.liferay.portal.kernel.exception.SystemException {
63 return getService().getGroupRoles(groupId);
64 }
65
66 public static com.liferay.portal.model.Role getRole(long roleId)
67 throws com.liferay.portal.kernel.exception.PortalException,
68 com.liferay.portal.kernel.exception.SystemException {
69 return getService().getRole(roleId);
70 }
71
72 public static com.liferay.portal.model.Role getRole(long companyId,
73 java.lang.String name)
74 throws com.liferay.portal.kernel.exception.PortalException,
75 com.liferay.portal.kernel.exception.SystemException {
76 return getService().getRole(companyId, name);
77 }
78
79 public static java.util.List<com.liferay.portal.model.Role> getUserGroupGroupRoles(
80 long userId, long groupId)
81 throws com.liferay.portal.kernel.exception.SystemException {
82 return getService().getUserGroupGroupRoles(userId, groupId);
83 }
84
85 public static java.util.List<com.liferay.portal.model.Role> getUserGroupRoles(
86 long userId, long groupId)
87 throws com.liferay.portal.kernel.exception.SystemException {
88 return getService().getUserGroupRoles(userId, groupId);
89 }
90
91 public static java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles(
92 long userId, java.util.List<com.liferay.portal.model.Group> groups)
93 throws com.liferay.portal.kernel.exception.SystemException {
94 return getService().getUserRelatedRoles(userId, groups);
95 }
96
97 public static java.util.List<com.liferay.portal.model.Role> getUserRoles(
98 long userId) throws com.liferay.portal.kernel.exception.SystemException {
99 return getService().getUserRoles(userId);
100 }
101
102 public static boolean hasUserRole(long userId, long companyId,
103 java.lang.String name, boolean inherited)
104 throws com.liferay.portal.kernel.exception.PortalException,
105 com.liferay.portal.kernel.exception.SystemException {
106 return getService().hasUserRole(userId, companyId, name, inherited);
107 }
108
109 public static boolean hasUserRoles(long userId, long companyId,
110 java.lang.String[] names, boolean inherited)
111 throws com.liferay.portal.kernel.exception.PortalException,
112 com.liferay.portal.kernel.exception.SystemException {
113 return getService().hasUserRoles(userId, companyId, names, inherited);
114 }
115
116 public static void unsetUserRoles(long userId, long[] roleIds)
117 throws com.liferay.portal.kernel.exception.PortalException,
118 com.liferay.portal.kernel.exception.SystemException {
119 getService().unsetUserRoles(userId, roleIds);
120 }
121
122 public static com.liferay.portal.model.Role updateRole(long roleId,
123 java.lang.String name,
124 java.util.Map<java.util.Locale, java.lang.String> titleMap,
125 java.lang.String description, java.lang.String subtype)
126 throws com.liferay.portal.kernel.exception.PortalException,
127 com.liferay.portal.kernel.exception.SystemException {
128 return getService()
129 .updateRole(roleId, name, titleMap, description, subtype);
130 }
131
132 public static RoleService getService() {
133 if (_service == null) {
134 _service = (RoleService)PortalBeanLocatorUtil.locate(RoleService.class.getName());
135 }
136
137 return _service;
138 }
139
140 public void setService(RoleService service) {
141 _service = service;
142 }
143
144 private static RoleService _service;
145 }