From 133da07764314a73452487603f6f509b05f96204 Mon Sep 17 00:00:00 2001 From: Maja Massarini Date: Jan 21 2024 23:14:38 +0000 Subject: Enable pull_request_update acl for user tokens Packit needs this acl to be able to update PRs it has already created. We are implementing this feature: https://github.com/packit/packit/issues/2182 --- diff --git a/pagure/default_config.py b/pagure/default_config.py index be14972..5a743a1 100644 --- a/pagure/default_config.py +++ b/pagure/default_config.py @@ -393,6 +393,7 @@ CROSS_PROJECT_ACLS = [ "group_modify", "update_watch_status", "pull_request_create", + "pull_request_update", "commit", ] diff --git a/tests/test_pagure_lib.py b/tests/test_pagure_lib.py index 9c8c7f8..3c00e0e 100644 --- a/tests/test_pagure_lib.py +++ b/tests/test_pagure_lib.py @@ -30,6 +30,8 @@ import pagure.lib.query import pagure.lib.model import tests +from pagure.config import config as pagure_config + class PagureLibtests_search_user(tests.Modeltests): """ @@ -5710,6 +5712,25 @@ foo bar [a.name for a in acls], ["create_project", "issue_create"] ) + def test_get_acls_restrict_CROSS_PROJECT_ACLS(self): + """Test CROSS_PROJECT_ACLS is well formed and working with get_acls.""" + acls = pagure.lib.query.get_acls( + self.session, restrict=pagure_config.get("CROSS_PROJECT_ACLS") + ) + self.assertEqual( + sorted([a.name for a in acls]), + [ + "commit", + "create_project", + "fork_project", + "group_modify", + "modify_project", + "pull_request_create", + "pull_request_update", + "update_watch_status", + ], + ) + def test_filter_img_src(self): """Test the filter_img_src function of pagure.lib.query.""" for name in ("alt", "height", "width", "class"):