diff --git a/Changelog.md b/Changelog.md
index 8eaaf3041c..214b3b9bc9 100644
--- a/Changelog.md
+++ b/Changelog.md
@@ -4,6 +4,8 @@
### 🚨 Breaking changes
+- Disallow peer reviewers from printing results (#7114)
+
### ✨ New features and improvements
- Allow deletion of assignments with no groups (#6880)
diff --git a/app/assets/javascripts/Components/Result/submission_selector.jsx b/app/assets/javascripts/Components/Result/submission_selector.jsx
index 66a0d9ad7e..306dcb8772 100644
--- a/app/assets/javascripts/Components/Result/submission_selector.jsx
+++ b/app/assets/javascripts/Components/Result/submission_selector.jsx
@@ -102,17 +102,19 @@ export class SubmissionSelector extends React.Component {
}
renderPrintButton() {
- return (
-
-
- {I18n.t("results.print")}
-
- );
+ if (!this.props.is_reviewer) {
+ return (
+
+
+ {I18n.t("results.print")}
+
+ );
+ }
}
onOpenFilterModal = () => {
diff --git a/app/policies/result_policy.rb b/app/policies/result_policy.rb
index 336680d26a..309b6651d4 100644
--- a/app/policies/result_policy.rb
+++ b/app/policies/result_policy.rb
@@ -2,9 +2,9 @@
class ResultPolicy < ApplicationPolicy
default_rule :manage?
alias_rule :get_test_runs_instructors_released?, to: :view_marks?
- alias_rule :create?, :add_extra_mark?, :remove_extra_mark?, :get_test_runs_instructors?,
+ alias_rule :create?, :add_extra_mark?, :remove_extra_mark?, :get_test_runs_instructors?, :print?,
:add_tag?, :remove_tag?, :revert_to_automatic_deductions?, :random_incomplete_submission?, to: :grade?
- alias_rule :show?, :get_annotations?, :print?, to: :view?
+ alias_rule :show?, :get_annotations?, to: :view?
alias_rule :edit?, :toggle_marking_state?, :update_overall_comment?, :next_grouping?, to: :review?
alias_rule :refresh_view_tokens?, :update_view_token_expiry?, to: :set_released_to_students?