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