mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-17 06:35:14 +08:00
18 lines
420 B
Ruby
18 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
|