1 # frozen_string_literal: true
4 include CanCan::Ability
12 if Settings.status != "database_offline"
13 can [:index, :show, :download], 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], 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, Way, Relation]
36 can [:destroy, :restore], ChangesetComment
39 can :redact, [OldNode, OldWay, OldRelation] if user.terms_agreed?
44 # Define abilities for the passed in user here. For example:
46 # user ||= User.new # guest user (not logged in)
53 # The first argument to `can` is the action you are giving the user
55 # If you pass :manage it will apply to every action. Other common actions
56 # here are :read, :create, :update and :destroy.
58 # The second argument is the resource the user can perform the action on.
59 # If you pass :all it will apply to every resource. Otherwise pass a Ruby
60 # class of the resource.
62 # The third argument is an optional hash of conditions to further filter the
64 # For example, here the user can only update published articles.
66 # can :update, Article, :published => true
68 # See the wiki for details:
69 # https://github.com/CanCanCommunity/cancancan/wiki/Defining-Abilities