diff --git a/src/yunohost/app.py b/src/yunohost/app.py index 0263a9d98..a19871699 100644 --- a/src/yunohost/app.py +++ b/src/yunohost/app.py @@ -717,7 +717,7 @@ def app_install(operation_logger, app, label=None, args=None, no_remove_on_failu # Initialize the main permission for the app # After the install, if apps don't have a domain and path defined, the default url '/' is removed from the permission - permission_create(app_instance_name+".main", url="/", allowed=["all_users"], label=label, show_tile=True, protected=False) + permission_create(app_instance_name+".main", allowed=["all_users"], label=label, show_tile=True, protected=False) # Execute the app install script install_failed = True @@ -830,12 +830,12 @@ def app_install(operation_logger, app, label=None, args=None, no_remove_on_failu os.system('chown -R root: %s' % app_setting_path) os.system('chown -R admin: %s/scripts' % app_setting_path) - # If an app doesn't have at least a domain and a path, assume it's not a webapp and remove the default "/" permission + # If the app haven't set the url of the main permission and domain and path is set set / as main url app_settings = _get_app_settings(app_instance_name) domain = app_settings.get('domain', None) path = app_settings.get('path', None) - if not (domain and path): - permission_url(app_instance_name + ".main", url=None, sync_perm=False) + if domain and path and user_permission_list(full=True, full_path=False)['permissions'][app_instance_name + '.main']['url'] is None: + permission_url(app_instance_name + ".main", url='/', sync_perm=False) _migrate_legacy_permissions(app_instance_name)