From bdb3e6dccb88e03c7ea57b781bafa869200f7624 Mon Sep 17 00:00:00 2001 From: Clement Verna Date: Jan 11 2018 09:06:04 +0000 Subject: Add is_repo_admin decorator to ui/plugins.py Signed-off-by: Clement Verna --- diff --git a/pagure/ui/plugins.py b/pagure/ui/plugins.py index 88ac26d..fc61ed1 100644 --- a/pagure/ui/plugins.py +++ b/pagure/ui/plugins.py @@ -23,6 +23,7 @@ import pagure.forms from pagure.exceptions import FileNotFoundException from pagure.ui import UI_NS from pagure.utils import login_required +from pagure.lib.decorators import is_repo_admin _log = logging.getLogger(__name__) @@ -69,16 +70,12 @@ _log = logging.getLogger(__name__) '/fork////settings//', methods=('GET', 'POST')) @login_required +@is_repo_admin def view_plugin(repo, plugin, username=None, namespace=None, full=True): """ Presents the settings of the project. """ repo = flask.g.repo - if not flask.g.repo_admin: - flask.abort( - 403, - 'You are not allowed to change the settings for this project') - # Private repos are not allowed to leak information outside so disabling CI # enables us to keep the repos totally discreate and prevents from leaking # information outside