We have several sub-accounts in Canvas. Each sub-account has their own sub-accounts too.
We also have several different account admin roles with different permissions.
Some people have the account admin; some people have sub-account admin; some people have course admin for whole institution; some people have course admin only for one of our campus; some people have course admin only for a department, etc.
Is there a quick way to get the user list for each admin role (account admin, course admin, sub-account admin, etc.) instead of looking for admins from each sub-account manually?
I asked this question about a year ago, and the answer was "no" at that time and I haven't seen anything to indicate a change has happened. I've since done a regular inventory of all 200+ accounts/subaccounts in our instance of Canvas manually. It would be nice if this function existed.
I have not looked into this recently, but thought there might be something in Canvas Data that would help.
I found the following SQL (MySQL flavor) will return everyone who has a special role other than student.
SELECT DISTINCT r.name, u.name
FROM role_dim r
JOIN enrollment_dim e ON (r.id = e.role_id)
JOIN user_dim u ON (e.user_id = u.id)
WHERE r.name != 'StudentEnrollment';
But alas, it failed to return a list of admins in those roles. The reason is that admins aren't course level enrollments, which is where the enrollment_dim information is pulled from. Admins are account level enrollments.
I leave the code there just in case someone else was looking for a list of non-student users and so someone won't waste their time trying to find it there.
There was another possibility with the enrollment_rollup_dim table and account_admin_role_count, but that failed to show anyone either.
It shouldn't have to be manually done, though (I say that, but things are often just not there).
The following API calls should be usable to automate the process (again, untested).
Then it's a matter of cycling through each of the accounts and subaccounts, fetching a list of admins, and matching the role_id from the admin list with the id from the list of roles.
Not as simple as being built-in, but it should be easier than manually maintaining the list.
I did save the code and run against my Canvas Data. Thanks for that. I agree though that better admin reporting would be wonderful.
Thanks. But I am not quite sure how to do the API calls.
But I have found I can get some data from Admins: Get :the live API page.
See the screenshot below. I need to type in the account_id to try it out. I just tried to type in 1, it returned the user data for "Course Admin". But I don't know the account_id for other admin roles.
You're not alone with not knowing how to use the APIs. It's has a learning curve to it and if you've not had any programming experience, then you're pretty much limited to using the live API like you did or putting the GET request in the browser. That works for small requests as you can add a per_page=100 to almost any GET request and get up to 100. Then you can copy/paste that into sites that convert JSON into CSV and get something usable. But a real solution should be programmed.
Most of the time it asks for an account ID, you can use self
Otherwise, you can go to the Admin menu and click on your account. The account number should be at the end of the URL
You need to start with the accounts and only do the admins after you have that list.
I threw together a user script over the weekend that would generate a list of admin users. You click a button, it makes all the API calls, and then generates a CSV file. It's added to Canvas through the use of a user script manager like Greasemonkey (Firefox) or Tampermonkey (Chrome or Safari)
It gets a list of account admins. It does not include a list of people who have an elevated level of access at a course level.
When ran from a sub-account, it only lists the admins for that subaccount and its child subaccounts.
Right now, I include the following information in the CSV file:
What I had available to pick from included:
Notes about the available data
The script is set up so that you can modify what information is displayed and what order it is displayed in. People can add or take away from the initial settings to meet their needs. You can always go in and add, remove, or reorder items to meet your needs.
The current state in column ordering in my development code is: Name, Role, Account, Login, Sortable_Name, Account_ID, User_ID, Role_ID, SIS_User, SIS_Login, SIS_Account
What I'm looking for is a reasonable set of defaults for the information displayed and the order it's displayed in. That is, what people will get if they don't go in and modify anything.
Currently, it adds a button on the main page for an account or subaccount (Admin > your account).
Is there a better place for it?
The original request here mentioned "course Admins".
The list of roles obtained includes other things besides account roles, but as far as I can tell (I might be missing something), there is nothing available through the API that says "Give me a list of all the people who have that role somewhere in the system". That means that you need to resort to some kind of iterating through each enrollment (whether by course, section, or user.
That means that this is a lengthy and time consuming process that is not suited for a place where a user clicks a button and wants an answer right away. The best approach right now might be to use Canvas Data to obtain a list of those users. I shared some code above, but it needs improved to make sure the enrollments are active and the provide additional information about the user and the course.
I probably won't use this script myself. We've got very few administrators at our institution and we know who they are. That means that I'm developing for an unknown audience and part of making it useful is making sure that the people who are going to use it are going to be able to get use out of it. It needs to be simple enough to install and use and yet powerful enough to accomplish what is needed.
It may sound like I've got things well thought out, but I'm not the one using it so this is your chance to provide feedback before the release.
In particular, I'm looking for suggestions on the following:
This script is essentially finished, I just need to do some more testing and write documentation. That means that I'm looking for tweaks that won't substantially delay its release. That also means that if you're not quick to provide feedback, it may get released before you get that chance.
Thanks very much!
When will the button be available to be used, please?
This will be awesome. I would probably but the account first so that you are grouping by account. We have 60 schools and that account identifies the school so you would be grouping by school. When you get to the user information, I would love to have sis_user_id first. It is not in Canvas Data at all but very important to us. Name is not unique, not even within a school. sis_user_id is our number and it is unique.
This will be extremely useful to us.