1
14
15 package com.liferay.portal.service.http;
16
17 import com.liferay.portal.kernel.log.Log;
18 import com.liferay.portal.kernel.log.LogFactoryUtil;
19 import com.liferay.portal.kernel.util.MethodHandler;
20 import com.liferay.portal.kernel.util.MethodKey;
21 import com.liferay.portal.security.auth.HttpPrincipal;
22 import com.liferay.portal.service.ResourcePermissionServiceUtil;
23
24
61 public class ResourcePermissionServiceHttp {
62 public static void addResourcePermission(HttpPrincipal httpPrincipal,
63 long groupId, long companyId, java.lang.String name, int scope,
64 java.lang.String primKey, long roleId, java.lang.String actionId)
65 throws com.liferay.portal.PortalException,
66 com.liferay.portal.SystemException {
67 try {
68 MethodKey methodKey = new MethodKey(ResourcePermissionServiceUtil.class.getName(),
69 "addResourcePermission",
70 _addResourcePermissionParameterTypes0);
71
72 MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
73 companyId, name, scope, primKey, roleId, actionId);
74
75 try {
76 TunnelUtil.invoke(httpPrincipal, methodHandler);
77 }
78 catch (Exception e) {
79 if (e instanceof com.liferay.portal.PortalException) {
80 throw (com.liferay.portal.PortalException)e;
81 }
82
83 if (e instanceof com.liferay.portal.SystemException) {
84 throw (com.liferay.portal.SystemException)e;
85 }
86
87 throw new com.liferay.portal.SystemException(e);
88 }
89 }
90 catch (com.liferay.portal.SystemException se) {
91 _log.error(se, se);
92
93 throw se;
94 }
95 }
96
97 public static void setIndividualResourcePermissions(
98 HttpPrincipal httpPrincipal, long groupId, long companyId,
99 java.lang.String name, java.lang.String primKey, long roleId,
100 java.lang.String[] actionIds)
101 throws com.liferay.portal.PortalException,
102 com.liferay.portal.SystemException {
103 try {
104 MethodKey methodKey = new MethodKey(ResourcePermissionServiceUtil.class.getName(),
105 "setIndividualResourcePermissions",
106 _setIndividualResourcePermissionsParameterTypes1);
107
108 MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
109 companyId, name, primKey, roleId, actionIds);
110
111 try {
112 TunnelUtil.invoke(httpPrincipal, methodHandler);
113 }
114 catch (Exception e) {
115 if (e instanceof com.liferay.portal.PortalException) {
116 throw (com.liferay.portal.PortalException)e;
117 }
118
119 if (e instanceof com.liferay.portal.SystemException) {
120 throw (com.liferay.portal.SystemException)e;
121 }
122
123 throw new com.liferay.portal.SystemException(e);
124 }
125 }
126 catch (com.liferay.portal.SystemException se) {
127 _log.error(se, se);
128
129 throw se;
130 }
131 }
132
133 public static void removeResourcePermission(HttpPrincipal httpPrincipal,
134 long groupId, long companyId, java.lang.String name, int scope,
135 java.lang.String primKey, long roleId, java.lang.String actionId)
136 throws com.liferay.portal.PortalException,
137 com.liferay.portal.SystemException {
138 try {
139 MethodKey methodKey = new MethodKey(ResourcePermissionServiceUtil.class.getName(),
140 "removeResourcePermission",
141 _removeResourcePermissionParameterTypes2);
142
143 MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
144 companyId, name, scope, primKey, roleId, actionId);
145
146 try {
147 TunnelUtil.invoke(httpPrincipal, methodHandler);
148 }
149 catch (Exception e) {
150 if (e instanceof com.liferay.portal.PortalException) {
151 throw (com.liferay.portal.PortalException)e;
152 }
153
154 if (e instanceof com.liferay.portal.SystemException) {
155 throw (com.liferay.portal.SystemException)e;
156 }
157
158 throw new com.liferay.portal.SystemException(e);
159 }
160 }
161 catch (com.liferay.portal.SystemException se) {
162 _log.error(se, se);
163
164 throw se;
165 }
166 }
167
168 public static void removeResourcePermissions(HttpPrincipal httpPrincipal,
169 long groupId, long companyId, java.lang.String name, int scope,
170 long roleId, java.lang.String actionId)
171 throws com.liferay.portal.PortalException,
172 com.liferay.portal.SystemException {
173 try {
174 MethodKey methodKey = new MethodKey(ResourcePermissionServiceUtil.class.getName(),
175 "removeResourcePermissions",
176 _removeResourcePermissionsParameterTypes3);
177
178 MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
179 companyId, name, scope, roleId, actionId);
180
181 try {
182 TunnelUtil.invoke(httpPrincipal, methodHandler);
183 }
184 catch (Exception e) {
185 if (e instanceof com.liferay.portal.PortalException) {
186 throw (com.liferay.portal.PortalException)e;
187 }
188
189 if (e instanceof com.liferay.portal.SystemException) {
190 throw (com.liferay.portal.SystemException)e;
191 }
192
193 throw new com.liferay.portal.SystemException(e);
194 }
195 }
196 catch (com.liferay.portal.SystemException se) {
197 _log.error(se, se);
198
199 throw se;
200 }
201 }
202
203 private static Log _log = LogFactoryUtil.getLog(ResourcePermissionServiceHttp.class);
204 private static final Class<?>[] _addResourcePermissionParameterTypes0 = new Class[] {
205 long.class, long.class, java.lang.String.class, int.class,
206 java.lang.String.class, long.class, java.lang.String.class
207 };
208 private static final Class<?>[] _setIndividualResourcePermissionsParameterTypes1 =
209 new Class[] {
210 long.class, long.class, java.lang.String.class,
211 java.lang.String.class, long.class, java.lang.String[].class
212 };
213 private static final Class<?>[] _removeResourcePermissionParameterTypes2 = new Class[] {
214 long.class, long.class, java.lang.String.class, int.class,
215 java.lang.String.class, long.class, java.lang.String.class
216 };
217 private static final Class<?>[] _removeResourcePermissionsParameterTypes3 = new Class[] {
218 long.class, long.class, java.lang.String.class, int.class,
219 long.class, java.lang.String.class
220 };
221 }