class FoldersController < ApplicationController
if Manifest.manifest.magic_numbers['run_mode'] == 0
- before_filter :authenticate_admin, :only => [:new, :create, :edit, :update, :destroy]
+ before_action :authenticate_admin, :only => [:new, :create, :edit, :update, :destroy]
else
- before_filter :authenticate_reader, :only => [:root, :index, :show, :watch]
- before_filter :authenticate_admin, :only => [:new, :create, :edit, :update, :destroy]
+ before_action :authenticate_reader, :only => [:root, :index, :show, :watch]
+ before_action :authenticate_admin, :only => [:new, :create, :edit, :update, :destroy]
end
def root
end
def index
- filer_list
+ if params['path'] # secret api
+ list = Folder.where(['name = ?', params['path']])
+ respond_to do |format|
+ format.json {
+ res = {
+ :page_status => {:type => :unlimited},
+ :list => list
+ }
+ render json: res.to_json
+ }
+ end
+ else
+ filer_list
+ end
end
def children_html_format format