Skip to content

Commit

Permalink
fix: don't show studio link when user is lmited_staff
Browse files Browse the repository at this point in the history
  • Loading branch information
ghassanmas committed Sep 30, 2024
1 parent a33db7f commit 3ca4cf9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
{% endif %}
{% endif %}
{% endif %}
<a href="{{studio_edit_url}}" class="ui-staff__button button-staff-studio" aria-expanded="false" data-panel="openassessment__staff-studio">{% trans "View ORA in Studio" %}</a>
{% if not is_limited_staff %}
<a href="{{studio_edit_url}}" class="ui-staff__button button-staff-studio" aria-expanded="false" data-panel="openassessment__staff-studio">{% trans "View ORA in Studio" %}</a>
{% endif %}
</div>

<div class="openassessment__staff-tools wrapper--staff-tools wrapper--ui-staff">
Expand Down
6 changes: 5 additions & 1 deletion openassessment/xblock/openassessmentblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -633,12 +633,16 @@ def student_view(self, context=None): # pylint: disable=unused-argument
leaderboard_model = model

# All data we intend to pass to the front end.
show_staff_area = self.is_course_staff and not self.in_studio_preview
block_user = self.runtime.service(self, "user").get_current_user()
is_limited_staff = show_staff_area and not and not has_studio_read_access(block_user,self.course_id)
context_dict = {
"leaderboard_modal": leaderboard_model,
"prompts": self.prompts,
"prompts_type": self.prompts_type,
"rubric_assessments": ui_models,
"show_staff_area": self.is_course_staff and not self.in_studio_preview,
"show_staff_area": show_staff_area,
"is_limited_staff": is_limited_staff,
"title": self.title,
"xblock_id": self.get_xblock_id(),
"course_id": self.course_id,
Expand Down

0 comments on commit 3ca4cf9

Please sign in to comment.