From cf3d3ad1960bf49662eef9a899e01883b465d152 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Aug 17 2017 14:09:16 +0000 Subject: Add feature allowing to prevent project creation in the UI only This allows to forbid project creation in the UI but still allow it via the API for the person having the API token with the corresponding ACL. Signed-off-by: Pierre-Yves Chibon --- diff --git a/doc/configuration.rst b/doc/configuration.rst index 7de3b6c..629f7f5 100644 --- a/doc/configuration.rst +++ b/doc/configuration.rst @@ -613,7 +613,19 @@ ENABLE_NEW_PROJECTS ~~~~~~~~~~~~~~~~~~~ This configuration key permits or forbids creation of new projects via -the user interface of this pagure instance. +the user interface and the API of this pagure instance. + +Defaults to: ``True`` + + +ENABLE_UI_NEW_PROJECTS +~~~~~~~~~~~~~~~~~~~~~~ + +This configuration key permits or forbids creation of new projects via +the user interface (only) of this pagure instance. It allows forbidding +to create new project in the user interface while letting a set of trusted +person to create projects via the API granted they have the API token with +the corresponding ACL. Defaults to: ``True`` diff --git a/pagure/templates/master.html b/pagure/templates/master.html index d757531..35f6e7d 100644 --- a/pagure/templates/master.html +++ b/pagure/templates/master.html @@ -39,7 +39,8 @@ - {% if config.get('ENABLE_NEW_PROJECTS', True) %} + {% if config.get('ENABLE_NEW_PROJECTS', True) and + config.get('ENABLE_UI_NEW_PROJECTS', True) %}