1 # frozen_string_literal: true
4 include CanCan::Ability
7 can :read, [:version, :capability, :permission, :map]
9 if Settings.status != "database_offline"
10 can [:read, :download], Changeset
11 can [:read, :create, :feed, :search], Note
15 can [:read, :full, :ways_for_node], Way
16 can [:read, :full, :relations_for_node, :relations_for_way, :relations_for_relation], Relation
17 can [:history, :read], [OldNode, OldWay, OldRelation]
21 can [:comment, :close, :reopen], Note
22 can [:read, :create, :update, :destroy], Trace
23 can [:details, :gpx_files], User
24 can [:read, :update, :update_all, :destroy], UserPreference
27 can [:create, :update, :upload, :close, :subscribe, :unsubscribe], Changeset
28 can :create, ChangesetComment
29 can [:create, :update, :delete], [Node, Way, Relation]
33 can [:destroy, :restore], ChangesetComment
36 can :redact, [OldNode, OldWay, OldRelation] if user.terms_agreed?
41 # Define abilities for the passed in user here. For example:
43 # user ||= User.new # guest user (not logged in)
50 # The first argument to `can` is the action you are giving the user
52 # If you pass :manage it will apply to every action. Other common actions
53 # here are :read, :create, :update and :destroy.
55 # The second argument is the resource the user can perform the action on.
56 # If you pass :all it will apply to every resource. Otherwise pass a Ruby
57 # class of the resource.
59 # The third argument is an optional hash of conditions to further filter the
61 # For example, here the user can only update published articles.
63 # can :update, Article, :published => true
65 # See the wiki for details:
66 # https://github.com/CanCanCommunity/cancancan/wiki/Defining-Abilities