src/org/ohmage/service/ObserverServices.java
public void verifyUserCanUpdateObserver(
			final String username,
			final String observerId)
			throws ServiceException {
		
		try {
			String owner = observerQueries.getOwner(observerId);
			// If there is no owner, that is because the stream doesn't exist.
			if(owner == null) {
				throw new ServiceException(
					ErrorCode.OBSERVER_INSUFFICIENT_PERMISSIONS,
					"An observer with the given ID does not exist.");
			}
			// If the requester is not the owner, then they do not have 
			// permission to update it.
			// If we open up the ACLs to allow others to update the observer,
			// this check would be altered and this is where those ACLs would
			// be applied.
			else if(! owner.equals(username)) {
				throw new ServiceException(
					ErrorCode.OBSERVER_INSUFFICIENT_PERMISSIONS,
					"The requester is not the owner of the observer.");
			}
		}
		catch(DataAccessException e) {
			throw new ServiceException(e);
		}
	}
/**
	 * Verifies that a user is allowed to update an observer.
	 * 
	 * @param username The user's username.
	 * 
	 * @param observerId The observer's unique identifier.
	 * 
	 * @throws ServiceException The user is not allowed to update the observer
	 * 							or there was an error.
	 */
Verifies that a user is allowed to update an observer.

@param username The user's username.

@param observerId The observer's unique identifier.

@throws ServiceException The user is not allowed to update the observer
or there was an error.
Verifies that a user is allowed to update an observer . @param username The user ' s username . @param observerId The observer ' s unique identifier . @throws ServiceException The user is not allowed to update the observer or there was an error .
public void verifyUserCanUpdateObserver(
			final String username,
			final String observerId)
			throws ServiceException {
		try {
			String owner = observerQueries.getOwner(observerId);
			if(owner == null) {
				throw new ServiceException(
					ErrorCode.OBSERVER_INSUFFICIENT_PERMISSIONS,
					"An observer with the given ID does not exist.");
			}
			else if(! owner.equals(username)) {
				throw new ServiceException(
					ErrorCode.OBSERVER_INSUFFICIENT_PERMISSIONS,
					"The requester is not the owner of the observer.");
			}
		}
		catch(DataAccessException e) {
			throw new ServiceException(e);
		}
	}
public void verifyUserCanUpdateObserver ( final String username , final String observerId ) throws ServiceException { try { String owner = observerQueries . getOwner ( observerId ) ; if ( owner == null ) { throw new ServiceException ( ErrorCode . OBSERVER_INSUFFICIENT_PERMISSIONS , "An observer with the given ID does not exist." ) ; } else if ( ! owner . equals ( username ) ) { throw new ServiceException ( ErrorCode . OBSERVER_INSUFFICIENT_PERMISSIONS , "The requester is not the owner of the observer." ) ; } } catch ( DataAccessException e ) { throw new ServiceException ( e ) ; } }
Verifies that a user is allowed to update an observer.
Verifies that a user is allowed to update an observer .
// If there is no owner, that is because the stream doesn't exist. // If the requester is not the owner, then they do not have  // permission to update it. // If we open up the ACLs to allow others to update the observer, // this check would be altered and this is where those ACLs would // be applied.