restricted_access => require_firstrun
We don't want to require a login session anymore in most cases, we have granular permissions for this.
This commit is contained in:
1 parent
e2a7e07a0a
commit
b6f71eeb3b
17 files changed
+106
-88
No files matched your search
@@ -12,7 +12,7 @@ import re
|
||||
from octoprint.settings import settings, valid_boolean_trues
|
||||
from octoprint.server import printer, printerProfileManager, NO_CONTENT
|
||||
from octoprint.server.api import api
|
||||
from octoprint.server.util.flask import restricted_access, get_json_command_from_request
|
||||
from octoprint.server.util.flask import require_firstrun, get_json_command_from_request
|
||||
|
||||
from octoprint.printer import UnknownScript
|
||||
|
||||
@@ -60,7 +60,7 @@ def printerState():
|
||||
|
||||
|
||||
@api.route("/printer/tool", methods=["POST"])
|
||||
@restricted_access
|
||||
@require_firstrun
|
||||
@Permissions.CONTROL.require(403)
|
||||
def printerToolCommand():
|
||||
if not printer.is_operational():
|
||||
@@ -150,6 +150,7 @@ def printerToolCommand():
|
||||
|
||||
|
||||
@api.route("/printer/tool", methods=["GET"])
|
||||
@require_firstrun
|
||||
@Permissions.STATUS.require(403)
|
||||
def printerToolState():
|
||||
if not printer.is_operational():
|
||||
@@ -162,7 +163,7 @@ def printerToolState():
|
||||
|
||||
|
||||
@api.route("/printer/bed", methods=["POST"])
|
||||
@restricted_access
|
||||
@require_firstrun
|
||||
@Permissions.CONTROL.require(403)
|
||||
def printerBedCommand():
|
||||
if not printer.is_operational():
|
||||
@@ -209,6 +210,7 @@ def printerBedCommand():
|
||||
|
||||
|
||||
@api.route("/printer/bed", methods=["GET"])
|
||||
@require_firstrun
|
||||
@Permissions.STATUS.require(403)
|
||||
def printerBedState():
|
||||
if not printer.is_operational():
|
||||
@@ -228,7 +230,7 @@ def printerBedState():
|
||||
|
||||
|
||||
@api.route("/printer/printhead", methods=["POST"])
|
||||
@restricted_access
|
||||
@require_firstrun
|
||||
@Permissions.CONTROL.require(403)
|
||||
def printerPrintheadCommand():
|
||||
valid_commands = {
|
||||
@@ -292,7 +294,7 @@ def printerPrintheadCommand():
|
||||
|
||||
|
||||
@api.route("/printer/sd", methods=["POST"])
|
||||
@restricted_access
|
||||
@require_firstrun
|
||||
@Permissions.CONTROL.require(403)
|
||||
def printerSdCommand():
|
||||
if not settings().getBoolean(["feature", "sdSupport"]):
|
||||
@@ -323,7 +325,7 @@ def printerSdCommand():
|
||||
|
||||
|
||||
@api.route("/printer/sd", methods=["GET"])
|
||||
@restricted_access
|
||||
@require_firstrun
|
||||
@Permissions.STATUS.require(403)
|
||||
def printerSdState():
|
||||
if not settings().getBoolean(["feature", "sdSupport"]):
|
||||
@@ -336,7 +338,7 @@ def printerSdState():
|
||||
|
||||
|
||||
@api.route("/printer/command", methods=["POST"])
|
||||
@restricted_access
|
||||
@require_firstrun
|
||||
@Permissions.CONTROL.require(403)
|
||||
def printerCommand():
|
||||
if not printer.is_operational():
|
||||
@@ -397,7 +399,7 @@ def printerCommand():
|
||||
return NO_CONTENT
|
||||
|
||||
@api.route("/printer/command/custom", methods=["GET"])
|
||||
@restricted_access
|
||||
@require_firstrun
|
||||
@Permissions.CONTROL.require(403)
|
||||
def getCustomControls():
|
||||
# TODO: document me
|
||||
|
||||
Reference in new issue
Block a user