From: Andy Allan Date: Wed, 9 Jan 2019 09:12:14 +0000 (+0100) Subject: Use CanCanCan for directions controller X-Git-Tag: live~3269^2~3 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/7420479cdea7629b66a2da628cfd4ace54567b68 Use CanCanCan for directions controller --- diff --git a/app/abilities/ability.rb b/app/abilities/ability.rb index b5026196f..fa0e30f03 100644 --- a/app/abilities/ability.rb +++ b/app/abilities/ability.rb @@ -6,6 +6,7 @@ class Ability def initialize(user) can [:relation, :relation_history, :way, :way_history, :node, :node_history, :changeset, :note], :browse can :index, ChangesetComment + can :search, :direction can [:index, :permalink, :edit, :help, :fixthemap, :offline, :export, :about, :preview, :copyright, :key, :id], :site can [:index, :rss, :show, :comments], DiaryEntry can [:finish, :embed], :export diff --git a/app/controllers/directions_controller.rb b/app/controllers/directions_controller.rb index b04db6b6f..ec2327400 100644 --- a/app/controllers/directions_controller.rb +++ b/app/controllers/directions_controller.rb @@ -2,6 +2,7 @@ class DirectionsController < ApplicationController before_action :authorize_web before_action :set_locale before_action :require_oauth, :only => [:search] + authorize_resource :class => false def search render :layout => map_layout