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