Add recursive parameter to Roles API

Currently if you want to get a list of all of the roles in a Canvas instance you need to do the following:

  1. Load all sub-accounts from the root account: https://canvas.instructure.com/doc/api/accounts.html#method.accounts.sub_accounts
  2. For every sub-account from #1, load the roles under that account: https://canvas.instructure.com/doc/api/roles.html#method.role_overrides.api_index

The end result of those two steps is a list of all the roles under every account in Canvas. The trouble is that step #2 takes a pretty long time to complete, for a pretty small amount of data. The API in #1 gives the option of a "recursive" parameter. If you pass that parameter it returns every sub-account in the hierarchy (without having the loop through).

The API in #2 could do exactly the same. It could accept a "recursive" parameter that gives all the roles under the entire hierarchy.

Interestingly the API in #2 provides a "show_inherited" parameter. This does the reverse of what I am looking for. It shows all roles "inherited", higher up in the Canvas hierarchy, rather than roles that lower in the hierarchy. My point is this shouldn't be too hard to implement because the reverse already exists.

To summarize the request: Add a "recursive" parameter to the Canvas Roles API.

Please note that it would be useful to extend this idea to all account level API endpoints, just like the courses endpoint does. Perhaps it is worth solving this problem at a broader scale rather than this one specific case.

The account admins endpoint is an example of another endpoint that could benefit from the "recursive" parameter: Admins - Canvas LMS REST API Documentation 

2 Comments
tlampley
Community Contributor

A noteworthy endeavor.  Thank you for placing it "on-the-table".

ProductPanda
Instructure
Instructure
Status changed to: Archived
Comments from Instructure

As part of the new Ideas & Themes process, all ideas in Idea Conversations were reviewed by the Product Team. Any Idea that was associated with an identified theme was moved to the new Idea & Themes space. Any Idea that was not part of the move is being marked as Archived. This will preserve the history of the conversations while also letting Community members know that Instructure will not explore the request at this time.