Add status destroy authorization to policy (#3453)
* Add status destroy authorization to policy * Create explicit unreblog status authorization
This commit is contained in:
parent
3576fa0d59
commit
33f669a5f8
6 changed files with 78 additions and 5 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue