Skip to content

Commit 53a8a39

Browse files
committed
fix for project show ability
1 parent 9a9591c commit 53a8a39

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

app/models/ability.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ def initialize(user)
2222
private
2323

2424
def define_common_non_student_abilities(user)
25+
can :show, Project, user_id: nil, school_id: nil, project_type: Project::Types::CODE_EDITOR_SCRATCH
2526
return if user&.student?
2627

2728
# Anyone can view projects not owned by a user or a school.

spec/features/scratch/showing_a_scratch_project_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
it 'returns a 200 ok if logged in for an anonymous scratch project' do
8585
authenticated_in_hydra_as(student)
8686
project = create(:scratch_project, locale: 'en', user_id: nil)
87-
get "/api/scratch/projects/#{project.identifier}"
87+
get "/api/scratch/projects/#{project.identifier}", headers: headers
8888

8989
expect(response).to have_http_status(:ok)
9090
end

0 commit comments

Comments
 (0)