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, 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 com.liferay.portal.model.Role getGroupRole(long companyId,
61 long groupId)
62 throws com.liferay.portal.kernel.exception.PortalException,
63 com.liferay.portal.kernel.exception.SystemException {
64 return getService().getGroupRole(companyId, groupId);
65 }
66
67 public static java.util.List<com.liferay.portal.model.Role> getGroupRoles(
68 long groupId)
69 throws com.liferay.portal.kernel.exception.SystemException {
70 return getService().getGroupRoles(groupId);
71 }
72
73 public static com.liferay.portal.model.Role getRole(long roleId)
74 throws com.liferay.portal.kernel.exception.PortalException,
75 com.liferay.portal.kernel.exception.SystemException {
76 return getService().getRole(roleId);
77 }
78
79 public static com.liferay.portal.model.Role getRole(long companyId,
80 java.lang.String name)
81 throws com.liferay.portal.kernel.exception.PortalException,
82 com.liferay.portal.kernel.exception.SystemException {
83 return getService().getRole(companyId, name);
84 }
85
86 public static java.util.List<com.liferay.portal.model.Role> getUserGroupGroupRoles(
87 long userId, long groupId)
88 throws com.liferay.portal.kernel.exception.SystemException {
89 return getService().getUserGroupGroupRoles(userId, groupId);
90 }
91
92 public static java.util.List<com.liferay.portal.model.Role> getUserGroupRoles(
93 long userId, long groupId)
94 throws com.liferay.portal.kernel.exception.SystemException {
95 return getService().getUserGroupRoles(userId, groupId);
96 }
97
98 public static java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles(
99 long userId, java.util.List<com.liferay.portal.model.Group> groups)
100 throws com.liferay.portal.kernel.exception.SystemException {
101 return getService().getUserRelatedRoles(userId, groups);
102 }
103
104 public static java.util.List<com.liferay.portal.model.Role> getUserRoles(
105 long userId) throws com.liferay.portal.kernel.exception.SystemException {
106 return getService().getUserRoles(userId);
107 }
108
109 public static boolean hasUserRole(long userId, long companyId,
110 java.lang.String name, boolean inherited)
111 throws com.liferay.portal.kernel.exception.PortalException,
112 com.liferay.portal.kernel.exception.SystemException {
113 return getService().hasUserRole(userId, companyId, name, inherited);
114 }
115
116 public static boolean hasUserRoles(long userId, long companyId,
117 java.lang.String[] names, boolean inherited)
118 throws com.liferay.portal.kernel.exception.PortalException,
119 com.liferay.portal.kernel.exception.SystemException {
120 return getService().hasUserRoles(userId, companyId, names, inherited);
121 }
122
123 public static void unsetUserRoles(long userId, long[] roleIds)
124 throws com.liferay.portal.kernel.exception.PortalException,
125 com.liferay.portal.kernel.exception.SystemException {
126 getService().unsetUserRoles(userId, roleIds);
127 }
128
129 public static com.liferay.portal.model.Role updateRole(long roleId,
130 java.lang.String name,
131 java.util.Map<java.util.Locale, String> titleMap,
132 java.lang.String description, java.lang.String subtype)
133 throws com.liferay.portal.kernel.exception.PortalException,
134 com.liferay.portal.kernel.exception.SystemException {
135 return getService()
136 .updateRole(roleId, name, titleMap, description, subtype);
137 }
138
139 public static RoleService getService() {
140 if (_service == null) {
141 _service = (RoleService)PortalBeanLocatorUtil.locate(RoleService.class.getName());
142 }
143
144 return _service;
145 }
146
147 public void setService(RoleService service) {
148 _service = service;
149 }
150
151 private static RoleService _service;
152 }