Add status destroy authorization to policy (#3453)
* Add status destroy authorization to policy * Create explicit unreblog status authorization
This commit is contained in:
committed by
Eugen Rochko
parent
3576fa0d59
commit
33f669a5f8
@ -79,7 +79,10 @@ class Api::V1::StatusesController < ApiController
|
||||
|
||||
def destroy
|
||||
@status = Status.where(account_id: current_user.account).find(params[:id])
|
||||
authorize @status, :destroy?
|
||||
|
||||
RemovalWorker.perform_async(@status.id)
|
||||
|
||||
render_empty
|
||||
end
|
||||
|
||||
@ -93,6 +96,8 @@ class Api::V1::StatusesController < ApiController
|
||||
@status = reblog.reblog
|
||||
@reblogs_map = { @status.id => false }
|
||||
|
||||
authorize reblog, :unreblog?
|
||||
|
||||
RemovalWorker.perform_async(reblog.id)
|
||||
|
||||
render :show
|
||||
|
Reference in New Issue
Block a user