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, :show], [OldNode, OldWay, OldRelation]
21 can [:show], UserBlock
24 can [:comment, :close, :reopen], Note
25 can [:create, :show, :update, :destroy, :data], Trace
26 can [:details, :gpx_files], User
27 can [:index, :show, :update, :update_all, :destroy], UserPreference
30 can [:create, :update, :upload, :close, :subscribe, :unsubscribe], Changeset
31 can :create, ChangesetComment
32 can [:create, :update, :delete], Node
33 can [:create, :update, :delete], Way
34 can [:create, :update, :delete], Relation
38 can [:destroy, :restore], ChangesetComment
44 can :redact, OldRelation
50 # Define abilities for the passed in user here. For example:
52 # user ||= User.new # guest user (not logged in)
59 # The first argument to `can` is the action you are giving the user
61 # If you pass :manage it will apply to every action. Other common actions
62 # here are :read, :create, :update and :destroy.
64 # The second argument is the resource the user can perform the action on.
65 # If you pass :all it will apply to every resource. Otherwise pass a Ruby
66 # class of the resource.
68 # The third argument is an optional hash of conditions to further filter the
70 # For example, here the user can only update published articles.
72 # can :update, Article, :published => true
74 # See the wiki for details:
75 # https://github.com/CanCanCommunity/cancancan/wiki/Defining-Abilities