lib/locklizard/publication_commands.rb
# Revoke all access to the publications, then apply again publications from publications array
# Bug? For some reason, publication ids are returned twice the same. Perhaps need to replace array returned with uniq?

Revoke all access to the publications, then apply again publications from publications array
Bug. For some reason, publication ids are returned twice the same.
Revoke all access to the publications then apply again publications from publications array Bug . For some reason publication ids are returned twice the same .
def grant_publication_access_for_controller(custid = nil, publications_array = nil)
    raise ArgumentError.new('Custid Parameter is nil. Aborting...') if custid.nil?
	http_result = revoke_publication_access(custid)
	if (http_result.is_a? HTTP::Response)
	  if success?(http_result.to_s)
	    unless publications_array.empty? 
          suburl = "&action=grant_publication_access"
	      suburl << "&custid=" + custid.to_s + "&" + "publication=" + publications_array.join(',')
	      call_target_url(suburl)
        end
	  else 
	    http_result.to_s 
	  end
	elsif http_result == "publication_ids_null"
	  if !publications_array.empty? 
        suburl = "&action=grant_publication_access"
	    suburl << "&custid=" + custid.to_s + "&" + "publication=" + publications_array.join(',')
	    call_target_url(suburl)
      end
	else
	  raise ArgumentError.new("ArgumentError in grant_publication_access")
	end
  end
def grant_publication_access_for_controller ( custid = nil , publications_array = nil ) raise ArgumentError . new ( 'Custid Parameter is nil. Aborting...' ) if custid . nil? http_result = revoke_publication_access ( custid ) if ( http_result . is_a? HTTP :: Response ) if success? ( http_result . to_s ) unless publications_array . empty? suburl = "&action=grant_publication_access" suburl << "&custid=" + custid . to_s + "&" + "publication=" + publications_array . join ( ',' ) call_target_url ( suburl ) end else http_result . to_s end elsif http_result == "publication_ids_null" if ! publications_array . empty? suburl = "&action=grant_publication_access" suburl << "&custid=" + custid . to_s + "&" + "publication=" + publications_array . join ( ',' ) call_target_url ( suburl ) end else raise ArgumentError . new ( "ArgumentError in grant_publication_access" ) end end
Revoke all access to the publications, then apply again publications from publications array
Bug?
Revoke all access to the publications then apply again publications from publications array Bug?
# raise ArgumentError.new('Publication parameter is not an Array. Aborting') if !publications_array.is_a? Array
 # if publications_array is not empty, grant publication access
 #just return the http result
 # if publications_array is not empty, grant publication access
 #return "HTTP Result:#{http_result.to_s}"

custid
publications_array