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
9 can :search, :direction
10 can [:index, :permalink, :edit, :help, :fixthemap, :offline, :export, :about, :preview, :copyright, :key, :id], :site
11 can [:finish, :embed], :export
12 can [:search, :search_latlon, :search_ca_postcode, :search_osm_nominatim,
13 :search_geonames, :search_osm_nominatim_reverse, :search_geonames_reverse], :geocoder
14 can [:token, :request_token, :access_token, :test_request], :oauth
16 if Settings.status != "database_offline"
17 can [:index, :feed], Changeset
18 can :index, ChangesetComment
19 can [:confirm, :confirm_resend, :confirm_email], :confirmation
20 can [:index, :rss, :show, :comments], DiaryEntry
22 can [:lost_password, :reset_password], :password
23 can [:index, :show], Redaction
24 can [:new, :create, :destroy], :session
25 can [:index, :show, :data, :georss, :picture, :icon], Trace
26 can [:terms, :new, :create, :save, :show, :auth_success, :auth_failure], User
27 can [:index, :show, :blocks_on, :blocks_by], UserBlock
28 can [:index, :show], Node
29 can [:index, :show, :full, :ways_for_node], Way
30 can [:index, :show, :full, :relations_for_node, :relations_for_way, :relations_for_relation], Relation
31 can [:history, :version], OldNode
32 can [:history, :version], OldWay
33 can [:history, :version], OldRelation
38 can [:revoke, :authorize], :oauth
40 if Settings.status != "database_offline"
41 can [:index, :new, :create, :show, :edit, :update, :destroy], ClientApplication
42 can [:index, :new, :create, :show, :edit, :update, :destroy], :oauth2_application
43 can [:index, :destroy], :oauth2_authorized_application
44 can [:new, :show, :create, :destroy], :oauth2_authorization
45 can [:new, :create, :edit, :update, :comment, :subscribe, :unsubscribe], DiaryEntry
46 can [:make_friend, :remove_friend], Friendship
47 can [:new, :create, :reply, :show, :inbox, :outbox, :mark, :destroy], Message
48 can [:close, :reopen], Note
49 can [:show, :edit, :update], :preference
50 can [:edit, :update], :profile
51 can [:new, :create], Report
52 can [:mine, :new, :create, :edit, :update, :destroy], Trace
53 can [:account, :go_public], User
56 can [:hide, :hidecomment], DiaryEntry
57 can [:index, :show, :resolve, :ignore, :reopen], Issue
58 can :create, IssueComment
59 can [:new, :create, :edit, :update, :destroy], Redaction
60 can [:new, :edit, :create, :update, :revoke], UserBlock
63 if user.administrator?
64 can [:hide, :unhide, :hidecomment, :unhidecomment], DiaryEntry
65 can [:index, :show, :resolve, :ignore, :reopen], Issue
66 can :create, IssueComment
67 can [:set_status, :destroy, :index], User
68 can [:grant, :revoke], UserRole
73 # Define abilities for the passed in user here. For example:
75 # user ||= User.new # guest user (not logged in)
82 # The first argument to `can` is the action you are giving the user
84 # If you pass :manage it will apply to every action. Other common actions
85 # here are :read, :create, :update and :destroy.
87 # The second argument is the resource the user can perform the action on.
88 # If you pass :all it will apply to every resource. Otherwise pass a Ruby
89 # class of the resource.
91 # The third argument is an optional hash of conditions to further filter the
93 # For example, here the user can only update published articles.
95 # can :update, Article, :published => true
97 # See the wiki for details:
98 # https://github.com/CanCanCommunity/cancancan/wiki/Defining-Abilities