Repository navigation
Task - implement grading permissions #320
Description
Activity
Refinement
Permissions used:
courses.view_grading_settingscourses.edit_grading_settings
Already in
src/authz/constants.tsasCOURSE_PERMISSIONS.VIEW_GRADING_SETTINGS/COURSE_PERMISSIONS.EDIT_GRADING_SETTINGSand insrc/authz/permissionHelpers.tsasgetGradingPermissions(courseId).Already resolved in
grading-settings/GradingSettings.jsxviauseCourseUserPermissionsascanViewGradingSettingsandcanEditGradingSettings;isEditableis already derived and threaded to all child components.Role matrix:
- Course Auditor (view ✅, edit ❌)
- Course Editor (view ✅, edit ✅).
All inputs in every subsection (
GradingScale,DeadlineSection,CreditSection,AssignmentSection) are alreadydisabled={!isEditable}— no change needed there. The three missing pieces are: the view-only banner, hiding the "Add new assignment type" button (currentlydisabled, must be hidden), and hiding the per-assignment "Delete" button (currentlydisabled, must be hidden). No new constants or helpers needed.
UI location 1 — Grading page: view-only banner + hide "Add new assignment type" button for Course Auditor
Files:
grading-settings/messages.ts→grading-settings/GradingSettings.jsxgrading-settings/messages.ts— add view-only alert message:viewOnlyAlert: { id: 'course-authoring.grading.alert.view-only', defaultMessage: 'You have view-only access to this page. Contact your organization admin to request editing permissions.', description: 'Alert shown to users who can view but cannot edit grading settings', },
generic/sub-header/SubHeader.tsx— addbannerprop (rendered after{title}inside the<h2>):interface SubHeaderProps { ... banner?: ReactElement | null; ... } const SubHeader = ({ ... banner = null, ... }) => ( ... <h2 className="sub-header-title"> <small className="sub-header-title-subtitle">{subtitle}</small> {title} {titleActions && ( ... )} </h2> {headerActions && ...} </header> {banner} {contentTitle && withSubHeaderContent && (
grading-settings/GradingSettings.jsx— addAlert+Lockimports, pass banner via the newSubHeaderprop, change Add button from disabled to conditionally rendered:// paragon imports — add Alert import { Alert, Button, Container, Layout, StatefulButton, } from '@openedx/paragon'; // icons imports — add Lock import { Add as IconAdd, CheckCircle, Lock as LockIcon, Warning } from '@openedx/paragon/icons'; ... <SubHeader title={intl.formatMessage(messages.headingTitle)} subtitle={intl.formatMessage(messages.headingSubtitle)} contentTitle={intl.formatMessage(messages.policy)} description={intl.formatMessage(messages.policiesDescription)} banner={!isEditable ? ( <Alert variant="info" icon={LockIcon}> {intl.formatMessage(messages.viewOnlyAlert)} </Alert> ) : null} /> <section> <GradingScale ... ... // change Add button — from disabled to hidden: {isEditable && ( <Button variant="primary" iconBefore={IconAdd} onClick={handleAddAssignment} > {intl.formatMessage(messages.addNewAssignmentTypeBtn)} </Button> )}
UI location 2 — Grading page: hide "Delete" button per assignment type for Course Auditor
File:
grading-settings/assignment-section/index.jsxgrading-settings/assignment-section/index.jsx— change Delete button from disabled to conditionally rendered:// was: <Button className="course-grading-assignment-delete-btn" variant="outline-primary" size="sm" onClick={() => handleRemoveAssignment(gradeField.id)} disabled={!isEditable} > {intl.formatMessage(messages.assignmentDeleteButton)} </Button> // change to: {isEditable && ( <Button className="course-grading-assignment-delete-btn" variant="outline-primary" size="sm" onClick={() => handleRemoveAssignment(gradeField.id)} > {intl.formatMessage(messages.assignmentDeleteButton)} </Button> )}
Testing implementation at https://github.com/eduNEXT/frontend-app-authoring/tree/bc/improve-grading-permissions

Most of the implementation has been done previously. I am going to open a same PR for those that have the View Only Alert including this one.
- moved this from Ready for Review to Done in RBAC AuthZ Board
on Aug 24, 2026
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone