We are trying to accomplish two things at the same time:
Stop scoping URLs and cookies to one organization
Start considering "DashboardAdmins" for permissions.
We can't completely separate the two so this PR tries to move in that direction without creating a huge PR.
This PR then:
Scopes cookies to /dashboard* URLs
Changes URLs that included the organization public ID to remove it.
Home / All courses now displays courses from organization you are an admin in & all the ones you are an instructor in.
As we no longer scope "all courses" to "all of this organization courses" we don't want to display all courses for staff members. Staff members don't have privileges on the "all courses" view. They need to add an explicit dashboard admin to the orgs they are interested in. We could in the future special case this for staff members so they don't need to that but also don't get into a situation where we try to list all courses in the DB. T
For follow up PRs:
Include all children organizations when filtering by organizations.
Apply the dashboard admin concept to assignment and student view. Currently
Testing
As a teacher and admin
-Login into canvas as: eng+canvasteacher2@hypothes.is
-Launch https://hypothesis.instructure.com/courses/125/assignments/873 and access the dashboard from there
-You should be able to see the list of students of that assignment, the assignment in the course and the course in "All courses".
-Include eng+canvasteacher2@hypothes.is as an admin the relevant organization, eg: http://localhost:8001/admin/orgs/1/dashboard-admins
-Refresh the all courses view, you should see now all courses on that org.
-Accessing the new courses/assignments won't work yet as an admin. Will tackle that on a PR focused on that.
-Listing all assignments in the course won't work either (you'll only see the one you launched). Also for a separate PR.
As staff
-Find the same assignment in the admin pages and launch the dashboard.
-You should be able to open it, go back to the parent course.
-Go all the way to the top, to "All courses". You'll get an empty list of courses.
-Add yourself, your google email address, to the org admins. The course list will include all the ones from that org.
We are trying to accomplish two things at the same time:
We can't completely separate the two so this PR tries to move in that direction without creating a huge PR.
This PR then:
For follow up PRs:
Testing
As a teacher and admin
-Login into canvas as: eng+canvasteacher2@hypothes.is -Launch https://hypothesis.instructure.com/courses/125/assignments/873 and access the dashboard from there -You should be able to see the list of students of that assignment, the assignment in the course and the course in "All courses". -Include eng+canvasteacher2@hypothes.is as an admin the relevant organization, eg: http://localhost:8001/admin/orgs/1/dashboard-admins -Refresh the all courses view, you should see now all courses on that org. -Accessing the new courses/assignments won't work yet as an admin. Will tackle that on a PR focused on that. -Listing all assignments in the course won't work either (you'll only see the one you launched). Also for a separate PR.
As staff
-Find the same assignment in the admin pages and launch the dashboard. -You should be able to open it, go back to the parent course. -Go all the way to the top, to "All courses". You'll get an empty list of courses. -Add yourself, your google email address, to the org admins. The course list will include all the ones from that org.