- can [:show, :download, :query], Changeset
- can [:index, :create, :comment, :feed, :show, :search], Note
- can :index, Tracepoint
- can [:index, :show], User
- can [:index, :show], Node
- can [:index, :show, :full, :ways_for_node], Way
- can [:index, :show, :full, :relations_for_node, :relations_for_way, :relations_for_relation], Relation
- can [:history, :version], OldNode
- can [:history, :version], OldWay
- can [:history, :version], OldRelation
- end
+ can [:read, :feed, :search], Note
+ can :create, Note unless user
+
+ can [:read, :download], Changeset
+ can :read, Tracepoint
+ can :read, User
+ can :read, [Node, Way, Relation, OldNode, OldWay, OldRelation]
+ can :read, UserBlock
+
+ if user&.active?
+ can [:create, :comment, :close, :reopen], Note if scopes.include?("write_notes")
+ can [:create, :destroy], NoteSubscription if scopes.include?("write_notes")
+
+ can :read, Trace if scopes.include?("read_gpx")
+ can [:create, :update, :destroy], Trace if scopes.include?("write_gpx")