1 # frozen_string_literal: true
4 include CanCan::Ability
7 can :index, ChangesetComment
8 can [:index, :permalink, :edit, :help, :fixthemap, :offline, :export, :about, :preview, :copyright, :key, :id], :site
9 can [:index, :rss, :show, :comments], DiaryEntry
10 can [:search, :search_latlon, :search_ca_postcode, :search_osm_nominatim,
11 :search_geonames, :search_osm_nominatim_reverse, :search_geonames_reverse], :geocoder
12 can [:index, :show], Redaction
13 can [:index, :show, :blocks_on, :blocks_by], UserBlock
17 can :create, ChangesetComment
18 can [:create, :edit, :comment, :subscribe, :unsubscribe], DiaryEntry
19 can [:new, :create], Report
20 can [:read, :read_one, :update, :update_one, :delete_one], UserPreference
23 can [:destroy, :restore], ChangesetComment
24 can [:index, :show, :resolve, :ignore, :reopen], Issue
25 can :create, IssueComment
26 can [:new, :create, :edit, :update, :destroy], Redaction
27 can [:new, :edit, :create, :update, :revoke], UserBlock
30 if user.administrator?
31 can [:hide, :hidecomment], [DiaryEntry, DiaryComment]
32 can [:index, :show, :resolve, :ignore, :reopen], Issue
33 can :create, IssueComment
37 # Define abilities for the passed in user here. For example:
39 # user ||= User.new # guest user (not logged in)
46 # The first argument to `can` is the action you are giving the user
48 # If you pass :manage it will apply to every action. Other common actions
49 # here are :read, :create, :update and :destroy.
51 # The second argument is the resource the user can perform the action on.
52 # If you pass :all it will apply to every resource. Otherwise pass a Ruby
53 # class of the resource.
55 # The third argument is an optional hash of conditions to further filter the
57 # For example, here the user can only update published articles.
59 # can :update, Article, :published => true
61 # See the wiki for details:
62 # https://github.com/CanCanCommunity/cancancan/wiki/Defining-Abilities