Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
405 errors should be 403
  • Loading branch information
aryarm committed Feb 24, 2019
commit 32df02bd57e8dd92fcaec75ec3370124438e4444
4 changes: 2 additions & 2 deletions app/Http/Controllers/ClassController.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,12 @@ public function destroy(Academic_Class $class)
// before deleting the class, make sure it doesn't have any classes attached underneath it
if ($class->children()->count() > 0)
{
abort(405, "You cannot delete a class that has children");
abort(403, "You cannot delete a class that has children");
}
// also make sure it doesn't have any resources attached to it
if ($class->resources()->count() > 0)
{
abort(405, "You cannot delete a class that has resources");
abort(403, "You cannot delete a class that has resources");
}
// actually delete the class
$class->delete();
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/ResourceController.php
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ public function detach(Resource $resource, Request $request){
}
else
{
abort(405, "Detaching this resource will attach it to the root, which is currently not allowed.");
abort(403, "Detaching this resource will attach it to the root, which is currently not allowed.");
}
}
}
Expand Down