agave-systems/systems-core/src/main/java/org/iplantc/service/systems/manager/SystemManager.java
/**
	 * Returns true if the api user has a role sufficient to perform management
	 * tasks such as updating and granting roles on this system.
	 * 
	 * @param system
	 * @param apiUsername
	 * @return
	 */
Returns true if the api user has a role sufficient to perform management
tasks such as updating and granting roles on this system.

@param system
@param apiUsername
@return
Returns true if the api user has a role sufficient to perform management tasks such as updating and granting roles on this system . @param system @param apiUsername @return
public boolean isManageableByUser(RemoteSystem system, String apiUsername)
	{
		if (StringUtils.isEmpty(apiUsername)) {
			throw new SystemException("No username provided.");
		}
		else if (system == null) {
			throw new SystemException("No shared system found matching that name");
		}
		else if (StringUtils.equals(apiUsername, Settings.PUBLIC_USER_USERNAME) ||
    			StringUtils.equals(apiUsername, Settings.WORLD_USER_USERNAME)) {
    		return false;
    	}
		else {
			SystemRole role = system.getUserRole(apiUsername);
			if (system.isPubliclyAvailable()) {
				return ServiceUtils.isAdmin(apiUsername);
			} 
			else {
				return (ServiceUtils.isAdmin(apiUsername) || 
						system.isOwnedBy(apiUsername) ||
						role.canAdmin());
			}
		}
	}
public boolean isManageableByUser ( RemoteSystem system , String apiUsername ) { if ( StringUtils . isEmpty ( apiUsername ) ) { throw new SystemException ( "No username provided." ) ; } else if ( system == null ) { throw new SystemException ( "No shared system found matching that name" ) ; } else if ( StringUtils . equals ( apiUsername , Settings . PUBLIC_USER_USERNAME ) || StringUtils . equals ( apiUsername , Settings . WORLD_USER_USERNAME ) ) { return false ; } else { SystemRole role = system . getUserRole ( apiUsername ) ; if ( system . isPubliclyAvailable ( ) ) { return ServiceUtils . isAdmin ( apiUsername ) ; } else { return ( ServiceUtils . isAdmin ( apiUsername ) || system . isOwnedBy ( apiUsername ) || role . canAdmin ( ) ) ; } } }
Returns true if the api user has a role sufficient to perform management
 tasks such as updating and granting roles on this system.
Returns true if the api user has a role sufficient to perform management tasks such as updating and granting roles on this system .