diff --git a/app/controllers/tasks_controller.rb b/app/controllers/tasks_controller.rb --- a/app/controllers/tasks_controller.rb +++ b/app/controllers/tasks_controller.rb @@ -1,7 +1,6 @@ class TasksController < ApplicationController - before_filter :authenticate - + before_filter :authenticate, :check_viewability def index redirect_to :action => 'list' @@ -12,4 +11,14 @@ @user = User.find(session[:user_id]) end + protected + + def check_viewability + user = User.find(session[:user_id]) + if user==nil or !Configuration.show_tasks_to?(user) + redirect_to :controller => 'main', :action => 'list' + return false + end + end + end