block public access setting

This commit is contained in:
Espen Antonsen 2009-08-03 16:39:33 +02:00
parent 6a5c5e9711
commit 1131c656d5
5 changed files with 8 additions and 4 deletions

View file

@ -1,5 +1,5 @@
class AlbumsController < ApplicationController
before_filter :check_public_access
before_filter :require_role_admin, :only => [:untouched, :new, :create, :edit, :update, :destroy]
def index

View file

@ -8,9 +8,12 @@ class ApplicationController < ActionController::Base
filter_parameter_logging :password, :password_confirmation
helper_method :current_user, :current_user_session
private
def check_public_access
require_user unless APP_CONFIG[:public]
end
def current_user_session
return @current_user_session if defined?(@current_user_session)

View file

@ -1,5 +1,5 @@
class CollectionsController < ApplicationController
before_filter :check_public_access
before_filter :require_role_admin, :only => [:new, :create, :edit, :update, :destroy]
def index

View file

@ -1,5 +1,5 @@
class PhotosController < ApplicationController
before_filter :check_public_access
before_filter :require_role_admin, :only => [:untouched, :upload, :new, :create, :edit, :update, :destroy]
def index

View file

@ -1,4 +1,5 @@
class TagsController < ApplicationController
before_filter :check_public_access
def index
if params[:album_id]