Project

General

Profile

Actions

Defect #12472

closed

Roles REST API does not accept API authentication

Added by Vincent Caron over 11 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Normal
Category:
REST API
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

While using the Roles REST API, I encountered a bogus issue with authentication while the global setting "Authentication required" was on : I could not fetch /roles.{json|xml}, I always got a 401 whatever auth I tried (cookie, plain, header).

The following patch against SVN trunk should fix it, at least it works correctly now for me :

Index: app/controllers/roles_controller.rb
===================================================================
--- app/controllers/roles_controller.rb (revision 10851)
+++ app/controllers/roles_controller.rb (working copy)
@@ -19,8 +19,8 @@
   layout 'admin'

   before_filter :require_admin, :except => [:index, :show]
-  before_filter :require_admin_or_api_request, :only => [:index, :show]
   before_filter :find_role, :only => [:show, :edit, :update, :destroy]
+  accept_api_auth :index, :show

   def index
     respond_to do |format|

Related issues

Related to Redmine - Feature #11502: Expose roles details via REST APIClosedJean-Philippe Lang

Actions
Actions

Also available in: Atom PDF