block public access setting
This commit is contained in:
parent
6a5c5e9711
commit
1131c656d5
5 changed files with 8 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
||||||
class AlbumsController < ApplicationController
|
class AlbumsController < ApplicationController
|
||||||
|
before_filter :check_public_access
|
||||||
before_filter :require_role_admin, :only => [:untouched, :new, :create, :edit, :update, :destroy]
|
before_filter :require_role_admin, :only => [:untouched, :new, :create, :edit, :update, :destroy]
|
||||||
|
|
||||||
def index
|
def index
|
||||||
|
|
|
@ -9,9 +9,12 @@ class ApplicationController < ActionController::Base
|
||||||
helper_method :current_user, :current_user_session
|
helper_method :current_user, :current_user_session
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
def check_public_access
|
||||||
|
require_user unless APP_CONFIG[:public]
|
||||||
|
end
|
||||||
|
|
||||||
def current_user_session
|
def current_user_session
|
||||||
return @current_user_session if defined?(@current_user_session)
|
return @current_user_session if defined?(@current_user_session)
|
||||||
@current_user_session = UserSession.find
|
@current_user_session = UserSession.find
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
class CollectionsController < ApplicationController
|
class CollectionsController < ApplicationController
|
||||||
|
before_filter :check_public_access
|
||||||
before_filter :require_role_admin, :only => [:new, :create, :edit, :update, :destroy]
|
before_filter :require_role_admin, :only => [:new, :create, :edit, :update, :destroy]
|
||||||
|
|
||||||
def index
|
def index
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
class PhotosController < ApplicationController
|
class PhotosController < ApplicationController
|
||||||
|
before_filter :check_public_access
|
||||||
before_filter :require_role_admin, :only => [:untouched, :upload, :new, :create, :edit, :update, :destroy]
|
before_filter :require_role_admin, :only => [:untouched, :upload, :new, :create, :edit, :update, :destroy]
|
||||||
|
|
||||||
def index
|
def index
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
class TagsController < ApplicationController
|
class TagsController < ApplicationController
|
||||||
|
before_filter :check_public_access
|
||||||
|
|
||||||
def index
|
def index
|
||||||
if params[:album_id]
|
if params[:album_id]
|
||||||
|
|
Loading…
Add table
Reference in a new issue