block public access setting
This commit is contained in:
parent
6a5c5e9711
commit
1131c656d5
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
class TagsController < ApplicationController
|
||||
before_filter :check_public_access
|
||||
|
||||
def index
|
||||
if params[:album_id]
|
||||
|
|
Loading…
Reference in a new issue