♻ Explicitly add admin group to plugin permissions
Admin only access by default for these was implied by not having them added to one of the three major default groups, making it explicit is more clear though.
This commit is contained in:
1 parent
47a9a40ec9
commit
c71972c0f8
4 files changed
+10
-1
No files matched your search
@@ -20,6 +20,7 @@ import flask
|
||||
|
||||
from collections import OrderedDict
|
||||
|
||||
from octoprint.access import ADMIN_GROUP
|
||||
from octoprint.access.permissions import Permissions
|
||||
from octoprint.server.util.flask import no_firstrun_access, with_revalidation_checking, check_etag
|
||||
from octoprint.util import utmify
|
||||
@@ -50,11 +51,13 @@ class AnnouncementPlugin(octoprint.plugin.AssetPlugin,
|
||||
dict(key="READ",
|
||||
name="Read announcements",
|
||||
description=gettext("Allows to read announcements"),
|
||||
default_groups=[ADMIN_GROUP],
|
||||
roles=["read"]),
|
||||
dict(key="MANAGE",
|
||||
name="Manage announcement subscriptions",
|
||||
description=gettext("Allows to manage announcement subscriptions. Includes \"Read announcements\" "
|
||||
"permission"),
|
||||
default_groups=[ADMIN_GROUP],
|
||||
roles=["manage"],
|
||||
permissions=["PLUGIN_ANNOUNCEMENTS_READ"])
|
||||
]
|
||||
|
||||
@@ -9,6 +9,7 @@ from octoprint.settings import settings
|
||||
|
||||
from octoprint.server import NO_CONTENT
|
||||
from octoprint.server.util.flask import redirect_to_tornado, no_firstrun_access
|
||||
from octoprint.access import ADMIN_GROUP
|
||||
from octoprint.access.permissions import Permissions
|
||||
|
||||
from flask import request, jsonify, url_for, make_response
|
||||
@@ -37,6 +38,7 @@ class LoggingPlugin(octoprint.plugin.AssetPlugin,
|
||||
dict(key="MANAGE",
|
||||
name="Logging management",
|
||||
description=gettext("Allows to download and delete log files and list and set log levels."),
|
||||
default_groups=[ADMIN_GROUP],
|
||||
roles=["manage"])
|
||||
]
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ import octoprint.plugin.core
|
||||
|
||||
from octoprint.settings import valid_boolean_trues
|
||||
from octoprint.server.util.flask import no_firstrun_access, with_revalidation_checking, check_etag
|
||||
from octoprint.access import ADMIN_GROUP
|
||||
from octoprint.access.permissions import Permissions
|
||||
from octoprint.util.pip import LocalPipCaller
|
||||
from octoprint.util.version import get_octoprint_version_string, get_octoprint_version, is_octoprint_compatible
|
||||
@@ -135,10 +136,12 @@ class PluginManagerPlugin(octoprint.plugin.SimpleApiPlugin,
|
||||
dict(key="MANAGE",
|
||||
name="Manage plugins",
|
||||
description=gettext("Allows to enable, disable and uninstall installed plugins."),
|
||||
default_groups=[ADMIN_GROUP],
|
||||
roles=["manage"]),
|
||||
dict(key="INSTALL",
|
||||
name="Install new plugins",
|
||||
description=gettext("Allows to install new plugins. Includes the \"Manage plugins\" permission."),
|
||||
default_groups=[ADMIN_GROUP],
|
||||
roles=["install"],
|
||||
permissions=["PLUGIN_PLUGINMANAGER_MANAGE"],
|
||||
dangerous=True)
|
||||
|
||||
@@ -26,7 +26,7 @@ from flask_babel import gettext
|
||||
|
||||
from octoprint.server.util.flask import no_firstrun_access, with_revalidation_checking, check_etag
|
||||
from octoprint.server import VERSION, REVISION, BRANCH
|
||||
from octoprint.access import USER_GROUP
|
||||
from octoprint.access import USER_GROUP, ADMIN_GROUP
|
||||
from octoprint.access.permissions import Permissions
|
||||
from octoprint.util import dict_merge, to_unicode
|
||||
from octoprint.util.version import get_comparable_version
|
||||
@@ -102,6 +102,7 @@ class SoftwareUpdatePlugin(octoprint.plugin.BlueprintPlugin,
|
||||
dict(key="UPDATE",
|
||||
name="Update",
|
||||
description=gettext("Allows to perform software updates"),
|
||||
default_groups=[ADMIN_GROUP],
|
||||
roles=["update"],
|
||||
dangerous=True)
|
||||
]
|
||||
|
||||
Reference in new issue
Block a user