1
22
23 package com.liferay.portal.service.http;
24
25 import com.liferay.portal.kernel.log.Log;
26 import com.liferay.portal.kernel.log.LogFactoryUtil;
27 import com.liferay.portal.service.PermissionServiceUtil;
28
29 import java.rmi.RemoteException;
30
31
81 public class PermissionServiceSoap {
82 public static void checkPermission(long groupId, long resourceId)
83 throws RemoteException {
84 try {
85 PermissionServiceUtil.checkPermission(groupId, resourceId);
86 }
87 catch (Exception e) {
88 _log.error(e, e);
89
90 throw new RemoteException(e.getMessage());
91 }
92 }
93
94 public static void checkPermission(long groupId, java.lang.String name,
95 long primKey) throws RemoteException {
96 try {
97 PermissionServiceUtil.checkPermission(groupId, name, primKey);
98 }
99 catch (Exception e) {
100 _log.error(e, e);
101
102 throw new RemoteException(e.getMessage());
103 }
104 }
105
106 public static void checkPermission(long groupId, java.lang.String name,
107 java.lang.String primKey) throws RemoteException {
108 try {
109 PermissionServiceUtil.checkPermission(groupId, name, primKey);
110 }
111 catch (Exception e) {
112 _log.error(e, e);
113
114 throw new RemoteException(e.getMessage());
115 }
116 }
117
118 public static boolean hasGroupPermission(long groupId,
119 java.lang.String actionId, long resourceId) throws RemoteException {
120 try {
121 boolean returnValue = PermissionServiceUtil.hasGroupPermission(groupId,
122 actionId, resourceId);
123
124 return returnValue;
125 }
126 catch (Exception e) {
127 _log.error(e, e);
128
129 throw new RemoteException(e.getMessage());
130 }
131 }
132
133 public static boolean hasUserPermission(long userId,
134 java.lang.String actionId, long resourceId) throws RemoteException {
135 try {
136 boolean returnValue = PermissionServiceUtil.hasUserPermission(userId,
137 actionId, resourceId);
138
139 return returnValue;
140 }
141 catch (Exception e) {
142 _log.error(e, e);
143
144 throw new RemoteException(e.getMessage());
145 }
146 }
147
148 public static boolean hasUserPermissions(long userId, long groupId,
149 com.liferay.portal.model.ResourceSoap[] resources,
150 java.lang.String actionId,
151 com.liferay.portal.security.permission.PermissionCheckerBag permissionCheckerBag)
152 throws RemoteException {
153 try {
154 boolean returnValue = PermissionServiceUtil.hasUserPermissions(userId,
155 groupId,
156 com.liferay.portal.model.impl.ResourceModelImpl.toModels(
157 resources), actionId, permissionCheckerBag);
158
159 return returnValue;
160 }
161 catch (Exception e) {
162 _log.error(e, e);
163
164 throw new RemoteException(e.getMessage());
165 }
166 }
167
168 public static void setGroupPermissions(long groupId,
169 java.lang.String[] actionIds, long resourceId)
170 throws RemoteException {
171 try {
172 PermissionServiceUtil.setGroupPermissions(groupId, actionIds,
173 resourceId);
174 }
175 catch (Exception e) {
176 _log.error(e, e);
177
178 throw new RemoteException(e.getMessage());
179 }
180 }
181
182 public static void setGroupPermissions(java.lang.String className,
183 java.lang.String classPK, long groupId, java.lang.String[] actionIds,
184 long resourceId) throws RemoteException {
185 try {
186 PermissionServiceUtil.setGroupPermissions(className, classPK,
187 groupId, actionIds, resourceId);
188 }
189 catch (Exception e) {
190 _log.error(e, e);
191
192 throw new RemoteException(e.getMessage());
193 }
194 }
195
196 public static void setOrgGroupPermissions(long organizationId,
197 long groupId, java.lang.String[] actionIds, long resourceId)
198 throws RemoteException {
199 try {
200 PermissionServiceUtil.setOrgGroupPermissions(organizationId,
201 groupId, actionIds, resourceId);
202 }
203 catch (Exception e) {
204 _log.error(e, e);
205
206 throw new RemoteException(e.getMessage());
207 }
208 }
209
210 public static void setRolePermission(long roleId, long groupId,
211 java.lang.String name, int scope, java.lang.String primKey,
212 java.lang.String actionId) throws RemoteException {
213 try {
214 PermissionServiceUtil.setRolePermission(roleId, groupId, name,
215 scope, primKey, actionId);
216 }
217 catch (Exception e) {
218 _log.error(e, e);
219
220 throw new RemoteException(e.getMessage());
221 }
222 }
223
224 public static void setRolePermissions(long roleId, long groupId,
225 java.lang.String[] actionIds, long resourceId)
226 throws RemoteException {
227 try {
228 PermissionServiceUtil.setRolePermissions(roleId, groupId,
229 actionIds, resourceId);
230 }
231 catch (Exception e) {
232 _log.error(e, e);
233
234 throw new RemoteException(e.getMessage());
235 }
236 }
237
238 public static void setUserPermissions(long userId, long groupId,
239 java.lang.String[] actionIds, long resourceId)
240 throws RemoteException {
241 try {
242 PermissionServiceUtil.setUserPermissions(userId, groupId,
243 actionIds, resourceId);
244 }
245 catch (Exception e) {
246 _log.error(e, e);
247
248 throw new RemoteException(e.getMessage());
249 }
250 }
251
252 public static void unsetRolePermission(long roleId, long groupId,
253 long permissionId) throws RemoteException {
254 try {
255 PermissionServiceUtil.unsetRolePermission(roleId, groupId,
256 permissionId);
257 }
258 catch (Exception e) {
259 _log.error(e, e);
260
261 throw new RemoteException(e.getMessage());
262 }
263 }
264
265 public static void unsetRolePermission(long roleId, long groupId,
266 java.lang.String name, int scope, java.lang.String primKey,
267 java.lang.String actionId) throws RemoteException {
268 try {
269 PermissionServiceUtil.unsetRolePermission(roleId, groupId, name,
270 scope, primKey, actionId);
271 }
272 catch (Exception e) {
273 _log.error(e, e);
274
275 throw new RemoteException(e.getMessage());
276 }
277 }
278
279 public static void unsetRolePermissions(long roleId, long groupId,
280 java.lang.String name, int scope, java.lang.String actionId)
281 throws RemoteException {
282 try {
283 PermissionServiceUtil.unsetRolePermissions(roleId, groupId, name,
284 scope, actionId);
285 }
286 catch (Exception e) {
287 _log.error(e, e);
288
289 throw new RemoteException(e.getMessage());
290 }
291 }
292
293 public static void unsetUserPermissions(long userId, long groupId,
294 java.lang.String[] actionIds, long resourceId)
295 throws RemoteException {
296 try {
297 PermissionServiceUtil.unsetUserPermissions(userId, groupId,
298 actionIds, resourceId);
299 }
300 catch (Exception e) {
301 _log.error(e, e);
302
303 throw new RemoteException(e.getMessage());
304 }
305 }
306
307 private static Log _log = LogFactoryUtil.getLog(PermissionServiceSoap.class);
308 }