1 # frozen_string_literal: true
4 include CanCan::Ability
7 can [:relation, :relation_history, :way, :way_history, :node, :node_history, :query], :browse
10 can [:show], OldRelation
11 can [:show, :new], Note
12 can :search, :direction
13 can [:index, :permalink, :edit, :help, :fixthemap, :offline, :export, :about, :communities, :preview, :copyright, :key, :id], :site
14 can [:finish, :embed], :export
15 can [:search, :search_latlon, :search_osm_nominatim, :search_osm_nominatim_reverse], :geocoder
16 can [:token, :request_token, :access_token, :test_request], :oauth
18 if Settings.status != "database_offline"
19 can [:index, :feed, :show], Changeset
20 can :index, ChangesetComment
21 can [:confirm, :confirm_resend, :confirm_email], :confirmation
22 can [:index, :rss, :show, :comments], DiaryEntry
24 can [:new, :create, :edit, :update], :password
25 can [:index, :show], Redaction
26 can [:new, :create, :destroy], :session
27 can [:index, :show, :data, :georss, :picture, :icon], Trace
28 can [:terms, :new, :create, :save, :suspended, :show, :auth_success, :auth_failure], User
29 can [:index, :show, :blocks_on, :blocks_by], UserBlock
34 can [:revoke, :authorize], :oauth
35 can [:show], :deletion
37 if Settings.status != "database_offline"
38 can [:subscribe, :unsubscribe], Changeset
39 can [:index, :new, :create, :show, :edit, :update, :destroy], ClientApplication
40 can [:index, :new, :create, :show, :edit, :update, :destroy], :oauth2_application
41 can [:index, :destroy], :oauth2_authorized_application
42 can [:new, :show, :create, :destroy], :oauth2_authorization
43 can [:edit, :update, :destroy], :account
44 can [:show], :dashboard
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, :muted, :mark, :unmute, :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
54 can [:index, :create, :destroy], UserMute
57 can [:hide, :unhide, :hidecomment, :unhidecomment], DiaryEntry
58 can [:index, :show, :resolve, :ignore, :reopen], Issue
59 can :create, IssueComment
60 can [:new, :create, :edit, :update, :destroy], Redaction
61 can [:new, :edit, :create, :update, :revoke, :revoke_all], UserBlock
64 if user.administrator?
65 can [:hide, :unhide, :hidecomment, :unhidecomment], DiaryEntry
66 can [:index, :show, :resolve, :ignore, :reopen], Issue
67 can :create, IssueComment
68 can [:set_status, :destroy, :index], User
69 can [:grant, :revoke], UserRole
74 # Define abilities for the passed in user here. For example:
76 # user ||= User.new # guest user (not logged in)
83 # The first argument to `can` is the action you are giving the user
85 # If you pass :manage it will apply to every action. Other common actions
86 # here are :read, :create, :update and :destroy.
88 # The second argument is the resource the user can perform the action on.
89 # If you pass :all it will apply to every resource. Otherwise pass a Ruby
90 # class of the resource.
92 # The third argument is an optional hash of conditions to further filter the
94 # For example, here the user can only update published articles.
96 # can :update, Article, :published => true
98 # See the wiki for details:
99 # https://github.com/CanCanCommunity/cancancan/wiki/Defining-Abilities