プロジェクト

全般

プロフィール

Vote #72282

完了

Expose roles details via REST API

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
REST API_32
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
32
version_id:
56
issue_org_id:
11502
author_id:
59477
assigned_to_id:
1
comments:
5
status_id:
5
tracker_id:
2
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

I recently needed a read-only access to the roles details via the REST API and implemented that - based on code from the original submission from #9725.

The patch adds a /roles/[id].:format route and a simple list of granted permissions for the requested role.

Also find attached a contribution to complete the existing doc at http://www.redmine.org/projects/redmine/wiki/Rest_Roles.


journals

I'm not sure that everyone want the details about all their roles to be publicly visible.
--------------------------------------------------------------------------------
Then we would need a right to have access to that roles information (at the moment onyl admin has this via web gui or using additional plugin like redmine_information (http://www.redmine.org/plugins/rp_information).

--------------------------------------------------------------------------------
Since I'm a Rails newbie I'm not sure I handled authentication correctly.

From my tests with my patch (using cookie-based auth with my browser) :
* /roles.xml is available without authentication (original behaviour)
* /roles/:id.xml requires auth, returns result for an admin, 403 Forbidden for other regular users

Is that fine ?

I might second Terence suggestion, in my case I'd be happy with a kind of read-only admin account (see everything, but don't touch anything) and finer grain permissions; but since the consumer is my own code in another controlled application, I know I only issue GETs and I'm pretty happy to access Redmine REST services at admin level.

Jean-Philippe : would you accept the attached patch while it has no POST /roles/:id.:format implementation ? I deliberately skipped that part.

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Committed in r10620 with tests. The API is available to everyone, just like /roles.xml.
--------------------------------------------------------------------------------


related_issues

relates,Closed,12472,Roles REST API does not accept API authentication

Admin Redmine さんが3年以上前に更新

  • カテゴリREST API_32 にセット
  • 対象バージョン2.2.0_56 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0