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