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