src/org/ohmage/service/MobilityServices.java
public void verifyUserCanUpdatePoint(
			final String username,
			final UUID mobilityId)
			throws ServiceException {
		
		try {
			// If the user is an admin, we are OK.
			if(userQueries.userIsAdmin(username)) {
				return;
			}
			
			// If the user owns the point, we are OK.
			String owner = userMobilityQueries.getUserForId(mobilityId);
			if((owner != null) && (owner.equals(username))) {
				return;
			}
			
			throw new ServiceException(
					ErrorCode.MOBILITY_INSUFFICIENT_PERMISSIONS,
					"You do not have permissions to modify this Mobility point.");
		}
		catch(DataAccessException e) {
			throw new ServiceException(e);
		}
	}
/**
	 * Verifies that a Mobility point can be updated by the requesting user.
	 * 
	 * @param username The requesting user's username.
	 * 
	 * @param mobilityId The Mobility point's unique identifier.
	 * 
	 * @throws ServiceException The user does not have sufficient permission to
	 * 							update the Mobility point.
	 */
Verifies that a Mobility point can be updated by the requesting user.

@param username The requesting user's username.

@param mobilityId The Mobility point's unique identifier.

@throws ServiceException The user does not have sufficient permission to
update the Mobility point.
Verifies that a Mobility point can be updated by the requesting user . @param username The requesting user ' s username . @param mobilityId The Mobility point ' s unique identifier . @throws ServiceException The user does not have sufficient permission to update the Mobility point .
public void verifyUserCanUpdatePoint(
			final String username,
			final UUID mobilityId)
			throws ServiceException {
		try {
			if(userQueries.userIsAdmin(username)) {
				return;
			}
			String owner = userMobilityQueries.getUserForId(mobilityId);
			if((owner != null) && (owner.equals(username))) {
				return;
			}
			throw new ServiceException(
					ErrorCode.MOBILITY_INSUFFICIENT_PERMISSIONS,
					"You do not have permissions to modify this Mobility point.");
		}
		catch(DataAccessException e) {
			throw new ServiceException(e);
		}
	}
public void verifyUserCanUpdatePoint ( final String username , final UUID mobilityId ) throws ServiceException { try { if ( userQueries . userIsAdmin ( username ) ) { return ; } String owner = userMobilityQueries . getUserForId ( mobilityId ) ; if ( ( owner != null ) && ( owner . equals ( username ) ) ) { return ; } throw new ServiceException ( ErrorCode . MOBILITY_INSUFFICIENT_PERMISSIONS , "You do not have permissions to modify this Mobility point." ) ; } catch ( DataAccessException e ) { throw new ServiceException ( e ) ; } }
Verifies that a Mobility point can be updated by the requesting user.
Verifies that a Mobility point can be updated by the requesting user .
// If the user is an admin, we are OK. // If the user owns the point, we are OK.