mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Define url of permission at the end of the app install
This commit is contained in:
parent
6e5e118bcf
commit
8fabd8f140
1 changed files with 4 additions and 4 deletions
|
@ -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
|
# 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
|
# 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
|
# Execute the app install script
|
||||||
install_failed = True
|
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 root: %s' % app_setting_path)
|
||||||
os.system('chown -R admin: %s/scripts' % 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)
|
app_settings = _get_app_settings(app_instance_name)
|
||||||
domain = app_settings.get('domain', None)
|
domain = app_settings.get('domain', None)
|
||||||
path = app_settings.get('path', None)
|
path = app_settings.get('path', None)
|
||||||
if not (domain and path):
|
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=None, sync_perm=False)
|
permission_url(app_instance_name + ".main", url='/', sync_perm=False)
|
||||||
|
|
||||||
_migrate_legacy_permissions(app_instance_name)
|
_migrate_legacy_permissions(app_instance_name)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue