From afdefcc44b0650bb465e296a26fef5d01d96af1e Mon Sep 17 00:00:00 2001 From: tituspijean Date: Fri, 18 Aug 2023 19:15:49 +0200 Subject: [PATCH] Require init_main_permission question for webapps (#115) * Require init_main_permission question for webapps * Require init_main_permission question for webapps, fixed Co-authored-by: Alexandre Aubin * Factorize a bit init_main_permission warning Co-authored-by: Alexandre Aubin * Enhance init_main_permission warning Co-authored-by: Alexandre Aubin --------- Co-authored-by: Alexandre Aubin --- package_linter.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/package_linter.py b/package_linter.py index d2b7810..7daed73 100755 --- a/package_linter.py +++ b/package_linter.py @@ -1974,6 +1974,17 @@ class Manifest(TestSuite): "When using a postgresql database, you should add postgresql in apt dependencies." ) + main_perm = self.manifest["resources"].get('permissions', {}).get('main', {}) + if ( + isinstance(main_perm.get('url'), str) + and "init_main_permission" not in self.manifest['install'] + and not main_perm.get('allowed') + ): + yield Warning( + "You should add a 'init_main_permission' question, or define `allowed` for main permission to have the app ready to be accessed right after installation." + ) + + @test() def manifest_schema(self):