Skip to content

Commit

Permalink
Disallow peer reviewers from printing results (#7114)
Browse files Browse the repository at this point in the history
  • Loading branch information
david-yz-liu authored Jun 10, 2024
1 parent 645916d commit db06086
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
2 changes: 2 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
24 changes: 13 additions & 11 deletions app/assets/javascripts/Components/Result/submission_selector.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,17 +102,19 @@ export class SubmissionSelector extends React.Component {
}

renderPrintButton() {
return (
<a
className={"button"}
href={Routes.print_course_result_path(this.props.course_id, this.props.result_id)}
style={{alignSelf: "flex-end"}}
title={I18n.t("results.print")}
>
<FontAwesomeIcon icon={"fa-solid fa-print"} />
<span className="button-text">{I18n.t("results.print")}</span>
</a>
);
if (!this.props.is_reviewer) {
return (
<a
className={"button"}
href={Routes.print_course_result_path(this.props.course_id, this.props.result_id)}
style={{alignSelf: "flex-end"}}
title={I18n.t("results.print")}
>
<FontAwesomeIcon icon={"fa-solid fa-print"} />
<span className="button-text">{I18n.t("results.print")}</span>
</a>
);
}
}

onOpenFilterModal = () => {
Expand Down
4 changes: 2 additions & 2 deletions app/policies/result_policy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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?

Expand Down

0 comments on commit db06086

Please sign in to comment.