001
014
015 package com.liferay.portal.service.http;
016
017 import com.liferay.portal.kernel.log.Log;
018 import com.liferay.portal.kernel.log.LogFactoryUtil;
019 import com.liferay.portal.service.PermissionServiceUtil;
020
021 import java.rmi.RemoteException;
022
023
066 public class PermissionServiceSoap {
067 public static void checkPermission(long groupId, long resourceId)
068 throws RemoteException {
069 try {
070 PermissionServiceUtil.checkPermission(groupId, resourceId);
071 }
072 catch (Exception e) {
073 _log.error(e, e);
074
075 throw new RemoteException(e.getMessage());
076 }
077 }
078
079 public static void checkPermission(long groupId, java.lang.String name,
080 long primKey) throws RemoteException {
081 try {
082 PermissionServiceUtil.checkPermission(groupId, name, primKey);
083 }
084 catch (Exception e) {
085 _log.error(e, e);
086
087 throw new RemoteException(e.getMessage());
088 }
089 }
090
091 public static void checkPermission(long groupId, java.lang.String name,
092 java.lang.String primKey) throws RemoteException {
093 try {
094 PermissionServiceUtil.checkPermission(groupId, name, primKey);
095 }
096 catch (Exception e) {
097 _log.error(e, e);
098
099 throw new RemoteException(e.getMessage());
100 }
101 }
102
103 public static boolean hasGroupPermission(long groupId,
104 java.lang.String actionId, long resourceId) throws RemoteException {
105 try {
106 boolean returnValue = PermissionServiceUtil.hasGroupPermission(groupId,
107 actionId, resourceId);
108
109 return returnValue;
110 }
111 catch (Exception e) {
112 _log.error(e, e);
113
114 throw new RemoteException(e.getMessage());
115 }
116 }
117
118 public static boolean hasUserPermission(long userId,
119 java.lang.String actionId, long resourceId) throws RemoteException {
120 try {
121 boolean returnValue = PermissionServiceUtil.hasUserPermission(userId,
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 hasUserPermissions(long userId, long groupId,
134 com.liferay.portal.model.ResourceSoap[] resources,
135 java.lang.String actionId,
136 com.liferay.portal.security.permission.PermissionCheckerBag permissionCheckerBag)
137 throws RemoteException {
138 try {
139 boolean returnValue = PermissionServiceUtil.hasUserPermissions(userId,
140 groupId,
141 com.liferay.portal.model.impl.ResourceModelImpl.toModels(
142 resources), actionId, permissionCheckerBag);
143
144 return returnValue;
145 }
146 catch (Exception e) {
147 _log.error(e, e);
148
149 throw new RemoteException(e.getMessage());
150 }
151 }
152
153 public static void setGroupPermissions(long groupId,
154 java.lang.String[] actionIds, long resourceId)
155 throws RemoteException {
156 try {
157 PermissionServiceUtil.setGroupPermissions(groupId, actionIds,
158 resourceId);
159 }
160 catch (Exception e) {
161 _log.error(e, e);
162
163 throw new RemoteException(e.getMessage());
164 }
165 }
166
167 public static void setGroupPermissions(java.lang.String className,
168 java.lang.String classPK, long groupId, java.lang.String[] actionIds,
169 long resourceId) throws RemoteException {
170 try {
171 PermissionServiceUtil.setGroupPermissions(className, classPK,
172 groupId, actionIds, resourceId);
173 }
174 catch (Exception e) {
175 _log.error(e, e);
176
177 throw new RemoteException(e.getMessage());
178 }
179 }
180
181 public static void setOrgGroupPermissions(long organizationId,
182 long groupId, java.lang.String[] actionIds, long resourceId)
183 throws RemoteException {
184 try {
185 PermissionServiceUtil.setOrgGroupPermissions(organizationId,
186 groupId, actionIds, resourceId);
187 }
188 catch (Exception e) {
189 _log.error(e, e);
190
191 throw new RemoteException(e.getMessage());
192 }
193 }
194
195 public static void setRolePermission(long roleId, long groupId,
196 java.lang.String name, int scope, java.lang.String primKey,
197 java.lang.String actionId) throws RemoteException {
198 try {
199 PermissionServiceUtil.setRolePermission(roleId, groupId, name,
200 scope, primKey, actionId);
201 }
202 catch (Exception e) {
203 _log.error(e, e);
204
205 throw new RemoteException(e.getMessage());
206 }
207 }
208
209 public static void setRolePermissions(long roleId, long groupId,
210 java.lang.String[] actionIds, long resourceId)
211 throws RemoteException {
212 try {
213 PermissionServiceUtil.setRolePermissions(roleId, groupId,
214 actionIds, resourceId);
215 }
216 catch (Exception e) {
217 _log.error(e, e);
218
219 throw new RemoteException(e.getMessage());
220 }
221 }
222
223 public static void setUserPermissions(long userId, long groupId,
224 java.lang.String[] actionIds, long resourceId)
225 throws RemoteException {
226 try {
227 PermissionServiceUtil.setUserPermissions(userId, groupId,
228 actionIds, resourceId);
229 }
230 catch (Exception e) {
231 _log.error(e, e);
232
233 throw new RemoteException(e.getMessage());
234 }
235 }
236
237 public static void unsetRolePermission(long roleId, long groupId,
238 long permissionId) throws RemoteException {
239 try {
240 PermissionServiceUtil.unsetRolePermission(roleId, groupId,
241 permissionId);
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 java.lang.String name, int scope, java.lang.String primKey,
252 java.lang.String actionId) throws RemoteException {
253 try {
254 PermissionServiceUtil.unsetRolePermission(roleId, groupId, name,
255 scope, primKey, actionId);
256 }
257 catch (Exception e) {
258 _log.error(e, e);
259
260 throw new RemoteException(e.getMessage());
261 }
262 }
263
264 public static void unsetRolePermissions(long roleId, long groupId,
265 java.lang.String name, int scope, java.lang.String actionId)
266 throws RemoteException {
267 try {
268 PermissionServiceUtil.unsetRolePermissions(roleId, groupId, name,
269 scope, actionId);
270 }
271 catch (Exception e) {
272 _log.error(e, e);
273
274 throw new RemoteException(e.getMessage());
275 }
276 }
277
278 public static void unsetUserPermissions(long userId, long groupId,
279 java.lang.String[] actionIds, long resourceId)
280 throws RemoteException {
281 try {
282 PermissionServiceUtil.unsetUserPermissions(userId, groupId,
283 actionIds, resourceId);
284 }
285 catch (Exception e) {
286 _log.error(e, e);
287
288 throw new RemoteException(e.getMessage());
289 }
290 }
291
292 private static Log _log = LogFactoryUtil.getLog(PermissionServiceSoap.class);
293 }