Use CanCanCan for browse controller

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

View file

@ -4,6 +4,7 @@ class Ability
include CanCan::Ability
def initialize(user)
can [:relation, :relation_history, :way, :way_history, :node, :node_history, :changeset, :note], :browse
can :index, ChangesetComment
can [:index, :permalink, :edit, :help, :fixthemap, :offline, :export, :about, :preview, :copyright, :key, :id], :site
can [:index, :rss, :show, :comments], DiaryEntry

View file

@ -6,6 +6,7 @@ class BrowseController < ApplicationController
before_action(:except => [:query]) { |c| c.check_database_readable(true) }
before_action :require_oauth
around_action :web_timeout
authorize_resource :class => false
def relation
@type = "relation"