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
28 can [:revoke, :authorize], :oauth
30 if Settings.status != "database_offline"
31 can [:index, :new, :create, :show, :edit, :update, :destroy], ClientApplication
32 can [:new, :create, :reply, :show, :inbox, :outbox, :mark, :destroy], Message
33 can [:close, :reopen], Note
34 can [:new, :create], Report
35 can [:create, :show, :update, :destroy, :data], Trace
36 can [:details, :gpx_files], User
37 can [:index, :show, :update, :update_all, :destroy], UserPreference
40 can [:create, :update, :upload, :close, :subscribe, :unsubscribe], Changeset
41 can :create, ChangesetComment
42 can [:create, :update, :delete], Node
43 can [:create, :update, :delete], Way
44 can [:create, :update, :delete], Relation
48 can [:destroy, :restore], ChangesetComment
54 can :redact, OldRelation
60 # Define abilities for the passed in user here. For example:
62 # user ||= User.new # guest user (not logged in)
69 # The first argument to `can` is the action you are giving the user
71 # If you pass :manage it will apply to every action. Other common actions
72 # here are :read, :create, :update and :destroy.
74 # The second argument is the resource the user can perform the action on.
75 # If you pass :all it will apply to every resource. Otherwise pass a Ruby
76 # class of the resource.
78 # The third argument is an optional hash of conditions to further filter the
80 # For example, here the user can only update published articles.
82 # can :update, Article, :published => true
84 # See the wiki for details:
85 # https://github.com/CanCanCommunity/cancancan/wiki/Defining-Abilities