]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/api_controller.rb
Localisation updates from https://translatewiki.net.
[rails.git] / app / controllers / api_controller.rb
index 25e1e3b95cc9edebaff056d1ea9fdbcf5ca22f98..ce1a217cd130c5fa5e07ac210a56b1c9621435f8 100644 (file)
@@ -263,6 +263,9 @@ class ApiController < ApplicationController
     area = XML::Node.new "area"
     area["maximum"] = MAX_REQUEST_AREA.to_s
     api << area
+    notearea = XML::Node.new "note_area"
+    notearea["maximum"] = MAX_NOTE_REQUEST_AREA.to_s
+    api << notearea
     tracepoints = XML::Node.new "tracepoints"
     tracepoints["per_page"] = TRACEPOINTS_PER_PAGE.to_s
     api << tracepoints
@@ -300,10 +303,9 @@ class ApiController < ApplicationController
   # * if authenticated via basic auth all permissions are granted, so the list will contain all permissions.
   # * unauthenticated users have no permissions, so the list will be empty.
   def permissions
-    @permissions = case
-                   when current_token.present?
+    @permissions = if current_token.present?
                      ClientApplication.all_permissions.select { |p| current_token.read_attribute(p) }
-                   when @user
+                   elsif @user
                      ClientApplication.all_permissions
                    else
                      []