Use CanCanCan for directions controller

This commit is contained in:
Andy Allan 2019-01-09 10:12:14 +01:00
parent 1e30edba53
commit 7420479cde
2 changed files with 2 additions and 0 deletions

View file

@ -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

View file

@ -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