@@ -181,76 +181,6 @@ protected CorrectnessCheckResult checkForCorrectUploadId(HttpServletRequest requ
181
181
return result ;
182
182
}
183
183
184
- /**
185
- * This method verifies the request for certain conditions to be met. This includes verifying
186
- * if the user has specified an ID of project he wants to perform an operation on, if the
187
- * ID of the project specified by user denotes an existing project, and whether the user
188
- * has enough rights to perform the operation specified by <code>permission</code> parameter.
189
- *
190
- * @return an instance of the {@link CorrectnessCheckResult} class, which specifies whether the
191
- * check was successful and, in the case the check was successful, contains additional
192
- * information retrieved during the check operation, which might be of some use for the
193
- * calling method.
194
- * @param request
195
- * the http request.
196
- * @param permission
197
- * permission to check against, or <code>null</code> if no check is required.
198
- * @throws BaseException
199
- * if any error occurs.
200
- */
201
- protected CorrectnessCheckResult checkForCorrectProjectId (HttpServletRequest request ,
202
- String permission ) throws BaseException {
203
- // Prepare bean that will be returned as the result
204
- CorrectnessCheckResult result = new CorrectnessCheckResult ();
205
-
206
- if (permission == null || permission .trim ().length () == 0 ) {
207
- permission = null ;
208
- }
209
-
210
- // Verify that Project ID was specified and denotes correct project
211
- String pidParam = request .getParameter ("pid" );
212
- if (pidParam == null || pidParam .trim ().length () == 0 ) {
213
- result .setResult (ActionsHelper .produceErrorReport (
214
- this , request , permission , "Error.ProjectIdNotSpecified" , null ));
215
- // Return the result of the check
216
- return result ;
217
- }
218
-
219
- long pid ;
220
-
221
- try {
222
- // Try to convert specified pid parameter to its integer representation
223
- pid = Long .parseLong (pidParam , 10 );
224
- } catch (NumberFormatException e ) {
225
- result .setResult (ActionsHelper .produceErrorReport (
226
- this , request , permission , "Error.ProjectNotFound" , null ));
227
- // Return the result of the check
228
- return result ;
229
- }
230
-
231
- // Retrieve the project following submission's information chain
232
- Project project = ActionsHelper .createProjectManager ().getProject (pid );
233
- if (project == null ) {
234
- result .setResult (ActionsHelper .produceErrorReport (
235
- this , request , permission , "Error.ProjectNotFound" , null ));
236
- // Return the result of the check
237
- return result ;
238
- }
239
-
240
- request .setAttribute ("pid" , pid );
241
-
242
- // Store Project object in the result bean
243
- result .setProject (project );
244
- // Place project as attribute in the request
245
- request .setAttribute ("project" , project );
246
-
247
- // Gather the roles the user has for current request
248
- AuthorizationHelper .gatherUserRoles (request , project .getId ());
249
-
250
- // Return the result of the check
251
- return result ;
252
- }
253
-
254
184
/**
255
185
* <p>
256
186
* Sends the content of specified file for downloading by client.
0 commit comments