read permissions on every GET
This commit is contained in:
@@ -257,7 +257,7 @@ def _log_to_dict(cur, row):
|
||||
# =============================================================================
|
||||
|
||||
@usb_bp.route('', methods=['GET'])
|
||||
@jwt_required(optional=True)
|
||||
@require_permission('usb.view')
|
||||
def list_usb_devices():
|
||||
"""List USB devices with checkout status.
|
||||
|
||||
@@ -306,7 +306,7 @@ def list_usb_devices():
|
||||
|
||||
|
||||
@usb_bp.route('/<device_id>', methods=['GET'])
|
||||
@jwt_required(optional=True)
|
||||
@require_permission('usb.view')
|
||||
def get_usb_device(device_id):
|
||||
"""Get a single device plus its last 20 check-in/out log rows."""
|
||||
if _usb_selfhosted():
|
||||
@@ -595,7 +595,7 @@ def checkin_device(device_id):
|
||||
# =============================================================================
|
||||
|
||||
@usb_bp.route('/<device_id>/history', methods=['GET'])
|
||||
@jwt_required(optional=True)
|
||||
@require_permission('usb.view')
|
||||
def get_device_history(device_id):
|
||||
"""Paginated check-in/out log for one device."""
|
||||
if _usb_selfhosted():
|
||||
@@ -625,7 +625,7 @@ def get_device_history(device_id):
|
||||
|
||||
|
||||
@usb_bp.route('/checkouts', methods=['GET'])
|
||||
@jwt_required(optional=True)
|
||||
@require_permission('usb.view')
|
||||
def list_all_checkouts():
|
||||
"""List check-out log rows.
|
||||
|
||||
@@ -676,7 +676,7 @@ def list_all_checkouts():
|
||||
|
||||
|
||||
@usb_bp.route('/checkouts/active', methods=['GET'])
|
||||
@jwt_required(optional=True)
|
||||
@require_permission('usb.view')
|
||||
def list_active_checkouts():
|
||||
"""List the latest check-out log row for every currently checked-out device.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user