Repository navigation
Description
Description
All course-app settings in Pages & Resources open through the same route, /pages-and-resources/:appId/settings, which loads the matching @openedx-plugins/course-app-<appId> package from plugins/course-apps. For view-only users (view_pages_and_resources without manage_pages_and_resources, e.g. a course auditor) the settings button is hidden, but the route has no permission check, so the modal can still be opened through a deep link.
Current Behavior
Opening /pages-and-resources/<appId>/settings as a view-only user shows the settings modal. What the user sees depends on the plugin:
- Plugins built on
AppSettingsModal(e.g. Progress, Calculator) readisEditablefromPagesAndResourcesContextand disable their controls, so the modal is read-only. - Plugins with a custom modal (e.g. ORA, Proctoring, Xpert unit summaries) do not read
isEditable, so the modal opens with all options enabled (e.g./pages-and-resources/ora_settings/settings). Saving fails only because the backend rejects the request.
Expected Behavior
A view-only user who navigates to a settings route is redirected to Pages & Resources and no settings modal is shown, regardless of how the plugin implements its modal.
Steps to reproduce
- Log in as a user with
view_pages_and_resourcesbut withoutmanage_pages_and_resources(e.g. course auditor). - Open
/pages-and-resources/ora_settings/settingsdirectly. - Observe that the modal opens with all options enabled; saving fails with a backend error.
Acceptance Criteria
- The
:appId/settingsroutes and the Discussions settings routes inPagesAndResourcesrequire the manage permission. - View-only users who open these routes by URL are redirected to Pages & Resources and no modal is shown.
- Users with the manage permission can still open every settings modal.
- Custom Pages (
/custom-pages, which is only reachable from its own entry point) disables its actions based onmanage.pages_and_resources. - Tests are added or updated.
Proposed Solution
- Preferred: guard the settings routes with the manage permission.
- Alternative: complete the
isEditablevalidation in each custom modal, asAppSettingsModalalready does.
Notes or Additional Context
The route guard only covers course apps installed at build time from plugins/course-apps (or other @openedx-plugins/course-app-* packages). Plugins added through a plugin slot (e.g. additional_course_plugin) do not use routes and open their own UI, so they must check permissions themselves, for example by reading isEditable from PagesAndResourcesContext.
Related: #286
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
fix: enforce pages and resources route permissions
fix(authz): validate permissions for deeplinks in pages and resources (…