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, java.rmi.RemoteException {
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, java.rmi.RemoteException {
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, java.rmi.RemoteException {
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, java.rmi.RemoteException {
70 return getService().getGroupRole(companyId, groupId);
71 }
72
73 public static java.util.List<com.liferay.portal.model.Role> getGroupRoles(
74 long groupId)
75 throws com.liferay.portal.SystemException, java.rmi.RemoteException {
76 return getService().getGroupRoles(groupId);
77 }
78
79 public static com.liferay.portal.model.Role getRole(long roleId)
80 throws com.liferay.portal.PortalException,
81 com.liferay.portal.SystemException, java.rmi.RemoteException {
82 return getService().getRole(roleId);
83 }
84
85 public static com.liferay.portal.model.Role getRole(long companyId,
86 java.lang.String name)
87 throws com.liferay.portal.PortalException,
88 com.liferay.portal.SystemException, java.rmi.RemoteException {
89 return getService().getRole(companyId, name);
90 }
91
92 public static java.util.List<com.liferay.portal.model.Role> getUserGroupRoles(
93 long userId, long groupId)
94 throws com.liferay.portal.SystemException, java.rmi.RemoteException {
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.SystemException, java.rmi.RemoteException {
101 return getService().getUserRelatedRoles(userId, groups);
102 }
103
104 public static java.util.List<com.liferay.portal.model.Role> getUserRoles(
105 long userId)
106 throws com.liferay.portal.SystemException, java.rmi.RemoteException {
107 return getService().getUserRoles(userId);
108 }
109
110 public static boolean hasUserRole(long userId, long companyId,
111 java.lang.String name, boolean inherited)
112 throws com.liferay.portal.PortalException,
113 com.liferay.portal.SystemException, java.rmi.RemoteException {
114 return getService().hasUserRole(userId, companyId, name, inherited);
115 }
116
117 public static boolean hasUserRoles(long userId, long companyId,
118 java.lang.String[] names, boolean inherited)
119 throws com.liferay.portal.PortalException,
120 com.liferay.portal.SystemException, java.rmi.RemoteException {
121 return getService().hasUserRoles(userId, companyId, names, inherited);
122 }
123
124 public static void unsetUserRoles(long userId, long[] roleIds)
125 throws com.liferay.portal.PortalException,
126 com.liferay.portal.SystemException, java.rmi.RemoteException {
127 getService().unsetUserRoles(userId, roleIds);
128 }
129
130 public static com.liferay.portal.model.Role updateRole(long roleId,
131 java.lang.String name, java.lang.String description)
132 throws com.liferay.portal.PortalException,
133 com.liferay.portal.SystemException, java.rmi.RemoteException {
134 return getService().updateRole(roleId, name, description);
135 }
136
137 public static RoleService getService() {
138 if (_service == null) {
139 throw new RuntimeException("RoleService is not set");
140 }
141
142 return _service;
143 }
144
145 public void setService(RoleService service) {
146 _service = service;
147 }
148
149 private static RoleService _service;
150 }