Skip to content
Snippets Groups Projects
Commit 5fe14ab8 authored by Bernardo Chagas's avatar Bernardo Chagas
Browse files

Change destroy method, only owner user can destroy collection

parent f0bd3723
No related branches found
No related tags found
No related merge requests found
......@@ -54,8 +54,12 @@ class V1::CollectionsController < ApplicationController
# DELETE /v1/collections/1
# DELETE /v1/collections/1.json
def destroy
@collection.destroy
render status: :ok
if @collection.user_own?(current_user)
@collection.destroy
render status: :ok
else
render status: :forbidden
end
end
# POST /v1/collections/!/items
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment