1 # frozen_string_literal: true
4 include CanCan::Ability
10 can :show, :permission
11 can [:search_all, :search_nodes, :search_ways, :search_relations], :search
12 can [:trackpoints], :swf
14 if Settings.status != "database_offline"
15 can [:show, :download, :query], Changeset
16 can [:index, :create, :comment, :feed, :show, :search], Note
17 can :index, Tracepoint
18 can [:index, :show], User
19 can [:index, :show], Node
20 can [:index, :show, :full, :ways_for_node], Way
21 can [:index, :show, :full, :relations_for_node, :relations_for_way, :relations_for_relation], Relation
22 can [:history, :version], OldNode
23 can [:history, :version], OldWay
24 can [:history, :version], OldRelation
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 [:read, :read_one, :update, :update_one, :delete_one], UserPreference
41 can [:create, :update, :upload, :close, :subscribe, :unsubscribe, :expand_bbox], 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