class AdminController < ApplicationController  

  permit 'authenticated'
  
  def index    
    store_location
    @show_admin_commands = permit?("admin")
    @owned_resources = Resource.find(:all, :conditions => [ "contact_email = ?", current_user.email ])
  end

  def delete
    @resource = Resource.find(params[:id])
    permit 'site_admin or owner of :resource' do
      if params[:commit] == "Yes, Really Delete it"
        @resource.destroy
        flash[:notice] = "Entry Deleted"
        redirect_to :action => 'index'
      end
    end
  rescue
    flash[:notice] = 'Could not delete given resource'
    redirect_to :action => 'index'
  end

  def dump
    @resource = Resource.find(params[:id])
  end

  def flags
  end

  def db
  end

end
