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 <alex.aubin@mailoo.org>

* Factorize a bit init_main_permission warning

Co-authored-by: Alexandre Aubin <alex.aubin@mailoo.org>

* Enhance init_main_permission warning

Co-authored-by: Alexandre Aubin <alex.aubin@mailoo.org>

---------

Co-authored-by: Alexandre Aubin <alex.aubin@mailoo.org>
This commit is contained in:
tituspijean 2023-08-18 19:15:49 +02:00 committed by GitHub
parent 0dd375db34
commit afdefcc44b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1974,6 +1974,17 @@ class Manifest(TestSuite):
"When using a postgresql database, you should add postgresql in apt dependencies." "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() @test()
def manifest_schema(self): def manifest_schema(self):