Skip to content

Commit ef08fba

Browse files
committed
Revert "add context route"
This reverts commit 268b7fa.
1 parent 268b7fa commit ef08fba

File tree

4 files changed

+3
-18
lines changed

4 files changed

+3
-18
lines changed

app/controllers/api/projects_controller.rb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
module Api
66
class ProjectsController < ApiController
77
before_action :authorize_user, only: %i[create update index destroy]
8-
before_action :load_project, only: %i[show update destroy context]
8+
before_action :load_project, only: %i[show update destroy]
99
before_action :load_projects, only: %i[index]
1010
load_and_authorize_resource
1111
before_action :verify_lesson_belongs_to_school, only: :create
@@ -52,10 +52,6 @@ def destroy
5252
head :ok
5353
end
5454

55-
def context
56-
render :context, formats: [:json]
57-
end
58-
5955
private
6056

6157
def verify_lesson_belongs_to_school

app/models/ability.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def define_school_teacher_abilities(user:, school:)
8585
can(%i[create], Project) do |project|
8686
school_teacher_can_manage_project?(user:, school:, project:)
8787
end
88-
can(%i[read update context], Project, school_id: school.id, lesson: { visibility: %w[teachers students] })
88+
can(%i[read update], Project, school_id: school.id, lesson: { visibility: %w[teachers students] })
8989
can(%i[read], Project,
9090
remixed_from_id: Project.where(school_id: school.id, remixed_from_id: nil, lesson_id: Lesson.where(school_class_id: ClassTeacher.where(teacher_id: user.id).select(:school_class_id))).pluck(:id))
9191
end
@@ -96,7 +96,7 @@ def define_school_student_abilities(user:, school:)
9696
# Ensure no access to ClassMember resources, relationships otherwise allow access in some circumstances.
9797
can(%i[read], Lesson, school_id: school.id, visibility: 'students', school_class: { students: { student_id: user.id } })
9898
can(%i[read create update], Project, school_id: school.id, user_id: user.id, lesson_id: nil)
99-
can(%i[read context], Project, lesson: { school_id: school.id, school_class: { students: { student_id: user.id } } })
99+
can(%i[read], Project, lesson: { school_id: school.id, school_class: { students: { student_id: user.id } } })
100100
can(%i[show_finished set_finished], SchoolProject, project: { user_id: user.id, lesson_id: nil }, school_id: school.id)
101101
end
102102

app/views/api/projects/context.json.jbuilder

Lines changed: 0 additions & 10 deletions
This file was deleted.

config/routes.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434

3535
resources :projects, only: %i[index show update destroy create] do
3636
get :finished, on: :member, to: 'school_projects#show_finished'
37-
get :context , on: :member, to: 'projects#context'
3837
put :finished, on: :member, to: 'school_projects#set_finished'
3938
resource :remix, only: %i[show create], controller: 'projects/remixes'
4039
resources :remixes, only: %i[index], controller: 'projects/remixes'

0 commit comments

Comments
 (0)