src/org/ohmage/service/AccessRequestServices.java
public void verifyUserCanAccessRequest(final String requestId, final String username) throws ServiceException {	
		try {
			if (! userSetupRequestQueries.getUserCanAccessRequest(requestId, username)) {
				throw new ServiceException(
						ErrorCode.USER_ACCESS_REQUEST_EXECUTION_ERROR,
						"Access denied. The user can't access the user setup request: " + requestId
					);
			}
		} catch (DataAccessException e) {
			throw new ServiceException(e);
		}
	}
/**
	 * Verify that the user can access the specific request. The admin can access any request.
	 * The owner can only access their requests.
	 *  
	 * @param requestId The request UUID.
	 *  
	 * @param username The username to check whether this person has access to the request. 
	 * 
	 * @throws ServiceException If the user doesn't have the right to access the request. 
	 * 
	 */
Verify that the user can access the specific request. The admin can access any request.
The owner can only access their requests.

@param requestId The request UUID.

@param username The username to check whether this person has access to the request.

@throws ServiceException If the user doesn't have the right to access the request.
Verify that the user can access the specific request . The admin can access any request . The owner can only access their requests . @param requestId The request UUID . @param username The username to check whether this person has access to the request . @throws ServiceException If the user doesn ' t have the right to access the request .
public void verifyUserCanAccessRequest(final String requestId, final String username) throws ServiceException {	
		try {
			if (! userSetupRequestQueries.getUserCanAccessRequest(requestId, username)) {
				throw new ServiceException(
						ErrorCode.USER_ACCESS_REQUEST_EXECUTION_ERROR,
						"Access denied. The user can't access the user setup request: " + requestId
					);
			}
		} catch (DataAccessException e) {
			throw new ServiceException(e);
		}
	}
public void verifyUserCanAccessRequest ( final String requestId , final String username ) throws ServiceException { try { if ( ! userSetupRequestQueries . getUserCanAccessRequest ( requestId , username ) ) { throw new ServiceException ( ErrorCode . USER_ACCESS_REQUEST_EXECUTION_ERROR , "Access denied. The user can't access the user setup request: " + requestId ) ; } } catch ( DataAccessException e ) { throw new ServiceException ( e ) ; } }
Verify that the user can access the specific request.
Verify that the user can access the specific request .