mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-16 22:25:30 +08:00
19 lines
420 B
Ruby
19 lines
420 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
module Users
|
||
|
class ConnectedDevicesController < ApplicationController
|
||
|
before_action :check_delete_permissions, only: :destroy
|
||
|
|
||
|
def destroy
|
||
|
@connected_device.destroy
|
||
|
end
|
||
|
|
||
|
private
|
||
|
|
||
|
def check_delete_permissions
|
||
|
@connected_device = ConnectedDevice.for_user(current_user).find_by(id: params[:id])
|
||
|
render_403 if @connected_device.blank?
|
||
|
end
|
||
|
end
|
||
|
end
|