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