1 # frozen_string_literal: true
4 include CanCan::Ability
12 if Settings.status != "database_offline"
13 can [:show, :download, :query], Changeset
14 can [:index, :create, :feed, :show, :search], Note
15 can :index, Tracepoint
16 can [:index, :show], User
17 can [:index, :show], Node
18 can [:index, :show, :full, :ways_for_node], Way
19 can [:index, :show, :full, :relations_for_node, :relations_for_way, :relations_for_relation], Relation
20 can [:history, :version], OldNode
21 can [:history, :version], OldWay
22 can [:history, :version], OldRelation
23 can [:show], UserBlock
26 can [:comment, :close, :reopen], Note
27 can [:create, :show, :update, :destroy, :data], Trace
28 can [:details, :gpx_files], User
29 can [:index, :show, :update, :update_all, :destroy], UserPreference
32 can [:create, :update, :upload, :close, :subscribe, :unsubscribe], Changeset
33 can :create, ChangesetComment
34 can [:create, :update, :delete], Node
35 can [:create, :update, :delete], Way
36 can [:create, :update, :delete], Relation
40 can [:destroy, :restore], ChangesetComment
46 can :redact, OldRelation
52 # Define abilities for the passed in user here. For example:
54 # user ||= User.new # guest user (not logged in)
61 # The first argument to `can` is the action you are giving the user
63 # If you pass :manage it will apply to every action. Other common actions
64 # here are :read, :create, :update and :destroy.
66 # The second argument is the resource the user can perform the action on.
67 # If you pass :all it will apply to every resource. Otherwise pass a Ruby
68 # class of the resource.
70 # The third argument is an optional hash of conditions to further filter the
72 # For example, here the user can only update published articles.
74 # can :update, Article, :published => true
76 # See the wiki for details:
77 # https://github.com/CanCanCommunity/cancancan/wiki/Defining-Abilities