Removed check_owner def of activity model - a logged in user can update/destroy any activity
This commit is contained in:
parent
27c86b0a5b
commit
9a28dba9cb
3 changed files with 1 additions and 28 deletions
|
|
@ -1,7 +1,6 @@
|
|||
class Api::V1::ActivitiesController < ApplicationController
|
||||
before_action :set_activity, only: %i[show update destroy]
|
||||
before_action :check_login
|
||||
before_action :check_owner, only: %i[update destroy]
|
||||
|
||||
def index
|
||||
render json: Activity.all
|
||||
|
|
@ -43,8 +42,4 @@ class Api::V1::ActivitiesController < ApplicationController
|
|||
def set_activity
|
||||
@activity = Activity.find(params[:id])
|
||||
end
|
||||
|
||||
def check_owner
|
||||
head :forbidden unless @activity.author_id == current_user&.id
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue