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