From 35a20fb5d920a7668f765846322b2c45e8f70da2 Mon Sep 17 00:00:00 2001
From: Israel Barreto Sant'Anna <ibsa14@inf.ufpr.br>
Date: Thu, 9 Feb 2017 10:31:50 -0200
Subject: [PATCH] Fixed publisher routes authentication

Signed-off-by: Israel Barreto Sant'Anna <ibsa14@inf.ufpr.br>
---
 app/controllers/concerns/publisher_controller.rb | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/app/controllers/concerns/publisher_controller.rb b/app/controllers/concerns/publisher_controller.rb
index c0d2acf1..dd385d9a 100644
--- a/app/controllers/concerns/publisher_controller.rb
+++ b/app/controllers/concerns/publisher_controller.rb
@@ -2,7 +2,7 @@ module PublisherController
   extend ActiveSupport::Concern
 
   included do
-    before_action :authenticate_user!, only: [:show_all_drafts, :show_liked_learning_objects, :show_liked_collections]
+    before_action :authenticate, only: [:show_all_drafts, :show_liked_learning_objects, :show_liked_collections]
     before_action :set_publisher, only: [:show_all_drafts, :show_all_learning_objects, :show_all_collections, :show_liked_learning_objects, :show_liked_collections]
     before_action -> { authorize @publisher }, only: [:show_all_drafts, :show_liked_learning_objects, :show_liked_collections]
   end
@@ -35,6 +35,10 @@ module PublisherController
 
   protected
 
+  def authenticate
+    authenticate_user!
+  end
+
   def set_publisher
     user, id = request.path.split('/')[2, 3]
     return nil unless %w(users institutions).include? user
-- 
GitLab