1 # frozen_string_literal: true
4 include CanCan::Ability
10 can :show, :permission
13 if Settings.status != "database_offline"
14 can [:show, :download, :query], Changeset
15 can [:index, :create, :comment, :feed, :show, :search], Note
16 can :index, Tracepoint
17 can [:index, :show], User
18 can [:index, :show], Node
19 can [:index, :show, :full, :ways_for_node], Way
20 can [:index, :show, :full, :relations_for_node, :relations_for_way, :relations_for_relation], Relation
21 can [:history, :version], OldNode
22 can [:history, :version], OldWay
23 can [:history, :version], OldRelation
24 can [:show], UserBlock
29 can [:revoke, :authorize], :oauth
31 if Settings.status != "database_offline"
32 can [:index, :new, :create, :show, :edit, :update, :destroy], ClientApplication
33 can [:new, :create, :reply, :show, :inbox, :outbox, :mark, :destroy], Message
34 can [:close, :reopen], Note
35 can [:new, :create], Report
36 can [:create, :show, :update, :destroy, :data], Trace
37 can [:details, :gpx_files], User
38 can [:index, :show, :update, :update_all, :destroy], UserPreference
41 can [:create, :update, :upload, :close, :subscribe, :unsubscribe], Changeset
42 can :create, ChangesetComment
43 can [:create, :update, :delete], Node
44 can [:create, :update, :delete], Way
45 can [:create, :update, :delete], Relation
49 can [:destroy, :restore], ChangesetComment
55 can :redact, OldRelation
61 # Define abilities for the passed in user here. For example:
63 # user ||= User.new # guest user (not logged in)
70 # The first argument to `can` is the action you are giving the user
72 # If you pass :manage it will apply to every action. Other common actions
73 # here are :read, :create, :update and :destroy.
75 # The second argument is the resource the user can perform the action on.
76 # If you pass :all it will apply to every resource. Otherwise pass a Ruby
77 # class of the resource.
79 # The third argument is an optional hash of conditions to further filter the
81 # For example, here the user can only update published articles.
83 # can :update, Article, :published => true
85 # See the wiki for details:
86 # https://github.com/CanCanCommunity/cancancan/wiki/Defining-Abilities