diff --git a/doc/development/api/plugins.rst b/doc/development/api/plugins.rst index f64973e2b..2bfb5b2b3 100644 --- a/doc/development/api/plugins.rst +++ b/doc/development/api/plugins.rst @@ -42,6 +42,13 @@ configuration class. The metadata class must define the following attributes: ``description`` (``str``): A more verbose description of what your plugin does. +``visible`` (``bool``): + ``True`` by default, can hide a plugin so it cannot be normally activated. + +``restricted`` (``bool``): + ``False`` by default, restricts a plugin such that it can only be enabled for an event + by system administrators / superusers. + A working example would be:: # file: pretix/plugins/timerestriction/__init__.py @@ -57,6 +64,8 @@ A working example would be:: name = _("PayPal") author = _("the pretix team") version = '1.0.0' + visible = True + restricted = False description = _("This plugin allows you to receive payments via PayPal") diff --git a/src/pretix/control/templates/pretixcontrol/event/plugins.html b/src/pretix/control/templates/pretixcontrol/event/plugins.html index 417381921..7c175715d 100644 --- a/src/pretix/control/templates/pretixcontrol/event/plugins.html +++ b/src/pretix/control/templates/pretixcontrol/event/plugins.html @@ -23,6 +23,8 @@
{{ plugin.description }}
+ {% if plugin.restricted and not request.user.is_superuser %} +