class Api::V1::ProjectsController < Api::V1::BaseController

  def index
    @bucket = Project
    @client = Client.find_by_id(params["client_id"])
    @bucket = @bucket.for_user(current_user)
    @bucket = @bucket.for_client(@client) if @client
    @projects = @bucket.order("name").all
    render :json => @projects
  end
end

class Api::V1::ProjectsController < Api::V1::BaseController
  def index
    @bucket = Project
    @bucket = @bucket.sort_by_name.for_client_id(params[:client_id])
    unless admin?
      @bucket = @bucket.for_user_and_role(current_user, :developer)
    end
    @projects = @bucket.order("name").all
    render :json => @projects
  end
end

Tweak projects api to show admins all projects, not just 'their 'projects
Tweak projects api to show admins all projects, not just 'their 'projects
