1 # frozen_string_literal: true
4 include CanCan::Ability
8 can :show, [Node, Way, Relation]
9 can [:index, :show], [OldNode, OldWay, OldRelation]
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, :show], Changeset
19 can :index, ChangesetComment
20 can [:confirm, :confirm_resend, :confirm_email], :confirmation
21 can [:index, :rss, :show], DiaryEntry
22 can :index, DiaryComment
24 can [:new, :create, :edit, :update], :password
25 can [:index, :show], Redaction
26 can [:new, :create, :destroy], :session
27 can [:index, :show, :data, :georss], 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, :subscribe, :unsubscribe], DiaryEntry
46 can [:create], DiaryComment
47 can [:make_friend, :remove_friend], Friendship
48 can [:new, :create, :reply, :show, :inbox, :outbox, :muted, :mark, :unmute, :destroy], Message
49 can [:close, :reopen], Note
50 can [:show, :edit, :update], :preference
51 can [:edit, :update], :profile
52 can [:new, :create], Report
53 can [:mine, :new, :create, :edit, :update, :destroy], Trace
54 can [:account, :go_public], User
55 can [:index, :create, :destroy], UserMute
58 can [:hide, :unhide], [DiaryEntry, DiaryComment]
59 can [:index, :show, :resolve, :ignore, :reopen], Issue
60 can :create, IssueComment
61 can [:new, :create, :edit, :update, :destroy], Redaction
62 can [:new, :edit, :create, :update, :revoke, :revoke_all], UserBlock
65 if user.administrator?
66 can [:hide, :unhide], [DiaryEntry, DiaryComment]
67 can [:index, :show, :resolve, :ignore, :reopen], Issue
68 can :create, IssueComment
69 can [:set_status, :destroy, :index], User
70 can [:grant, :revoke], UserRole
75 # Define abilities for the passed in user here. For example:
77 # user ||= User.new # guest user (not logged in)
84 # The first argument to `can` is the action you are giving the user
86 # If you pass :manage it will apply to every action. Other common actions
87 # here are :read, :create, :update and :destroy.
89 # The second argument is the resource the user can perform the action on.
90 # If you pass :all it will apply to every resource. Otherwise pass a Ruby
91 # class of the resource.
93 # The third argument is an optional hash of conditions to further filter the
95 # For example, here the user can only update published articles.
97 # can :update, Article, :published => true
99 # See the wiki for details:
100 # https://github.com/CanCanCommunity/cancancan/wiki/Defining-Abilities