agave-apps/apps-core/src/main/java/org/iplantc/service/apps/managers/ApplicationManager.java
/**
	 * Verifies that the given user can publish the given Software. Requirements 
	 * are that the user must have RoleType.PUBLISH on the Software.executionSystem
	 * and RoleType.USER on the Software.storageSystem.
	 * 
	 * @param username the user to check publish permissions
	 * @param newSoftware the software desiring to be published
	 * @return true if the user has permission, false otherwise
	 * @throws SystemUnknownException if no execution system is provided
	 */
Verifies that the given user can publish the given Software.

@param username the user to check publish permissions
@param newSoftware the software desiring to be published
@return true if the user has permission, false otherwise
@throws SystemUnknownException if no execution system is provided
Verifies that the given user can publish the given Software . @param username the user to check publish permissions @param newSoftware the software desiring to be published @return true if the user has permission false otherwise @throws SystemUnknownException if no execution system is provided
public static boolean userCanPublish(String username, Software newSoftware) throws SystemUnknownException
	{
		if (newSoftware.isPubliclyAvailable()) {
			return ServiceUtils.isAdmin(username); 
		} else if (newSoftware.getExecutionSystem() == null) {
		    throw new SystemUnknownException("No execution system given.");
		} else {
			return ServiceUtils.isAdmin(username) || (
					newSoftware.getExecutionSystem().getUserRole(username).canPublish());
		}
	}
public static boolean userCanPublish ( String username , Software newSoftware ) throws SystemUnknownException { if ( newSoftware . isPubliclyAvailable ( ) ) { return ServiceUtils . isAdmin ( username ) ; } else if ( newSoftware . getExecutionSystem ( ) == null ) { throw new SystemUnknownException ( "No execution system given." ) ; } else { return ServiceUtils . isAdmin ( username ) || ( newSoftware . getExecutionSystem ( ) . getUserRole ( username ) . canPublish ( ) ) ; } }
Verifies that the given user can publish the given Software.
Verifies that the given user can publish the given Software .