1 # frozen_string_literal: true
4 include CanCan::Ability
7 can [:relation, :relation_history, :way, :way_history, :node, :node_history,
8 :changeset, :note, :new_note, :query], :browse
11 can [:index, :feed, :show, :download, :query], Changeset
12 can :index, ChangesetComment
13 can :search, :direction
14 can [:index, :permalink, :edit, :help, :fixthemap, :offline, :export, :about, :preview, :copyright, :key, :id], :site
15 can [:index, :rss, :show, :comments], DiaryEntry
16 can [:finish, :embed], :export
17 can [:search, :search_latlon, :search_ca_postcode, :search_osm_nominatim,
18 :search_geonames, :search_osm_nominatim_reverse, :search_geonames_reverse], :geocoder
20 can [:index, :create, :comment, :feed, :show, :search, :mine], Note
21 can [:token, :request_token, :access_token, :test_request], :oauth
22 can :show, :permission
23 can [:index, :show], Redaction
24 can [:search_all, :search_nodes, :search_ways, :search_relations], :search
25 can [:trackpoints], :swf
26 can [:index, :show, :data, :georss, :picture, :icon], Trace
27 can :index, Tracepoint
28 can [:terms, :api_users, :login, :logout, :new, :create, :save, :confirm, :confirm_resend, :confirm_email, :lost_password, :reset_password, :show, :api_read, :auth_success, :auth_failure], User
29 can [:index, :show, :blocks_on, :blocks_by], UserBlock
30 can [:index, :show], Node
31 can [:index, :show, :full, :ways_for_node], Way
32 can [:index, :show, :full, :relations_for_node, :relations_for_way, :relations_for_relation], Relation
33 can [:history, :version], OldNode
34 can [:history, :version], OldWay
35 can [:history, :version], OldRelation
39 can [:index, :new, :create, :show, :edit, :update, :destroy], ClientApplication
40 can [:create, :edit, :comment, :subscribe, :unsubscribe], DiaryEntry
41 can [:new, :create, :reply, :show, :inbox, :outbox, :mark, :destroy], Message
42 can [:close, :reopen], Note
43 can [:revoke, :authorize], :oauth
44 can [:new, :create], Report
45 can [:mine, :new, :create, :edit, :update, :delete, :api_create, :api_read, :api_update, :api_delete, :api_data], Trace
46 can [:account, :go_public, :make_friend, :remove_friend, :api_details, :api_gpx_files], User
47 can [:read, :read_one, :update, :update_one, :delete_one], UserPreference
50 can [:create, :update, :upload, :close, :subscribe, :unsubscribe, :expand_bbox], Changeset
51 can :create, ChangesetComment
52 can [:create, :update, :delete], Node
53 can [:create, :update, :delete], Way
54 can [:create, :update, :delete], Relation
58 can [:destroy, :restore], ChangesetComment
59 can [:index, :show, :resolve, :ignore, :reopen], Issue
60 can :create, IssueComment
62 can [:new, :create, :edit, :update, :destroy], Redaction
63 can [:new, :edit, :create, :update, :revoke], UserBlock
67 can :redact, OldRelation
71 if user.administrator?
72 can [:hide, :hidecomment], [DiaryEntry, DiaryComment]
73 can [:index, :show, :resolve, :ignore, :reopen], Issue
74 can :create, IssueComment
75 can [:set_status, :delete, :index], User
76 can [:grant, :revoke], UserRole
80 # Define abilities for the passed in user here. For example:
82 # user ||= User.new # guest user (not logged in)
89 # The first argument to `can` is the action you are giving the user
91 # If you pass :manage it will apply to every action. Other common actions
92 # here are :read, :create, :update and :destroy.
94 # The second argument is the resource the user can perform the action on.
95 # If you pass :all it will apply to every resource. Otherwise pass a Ruby
96 # class of the resource.
98 # The third argument is an optional hash of conditions to further filter the
100 # For example, here the user can only update published articles.
102 # can :update, Article, :published => true
104 # See the wiki for details:
105 # https://github.com/CanCanCommunity/cancancan/wiki/Defining-Abilities