diff --git a/data/actionsmap/yunohost.yml b/data/actionsmap/yunohost.yml index 966de21df..101ac45e1 100644 --- a/data/actionsmap/yunohost.yml +++ b/data/actionsmap/yunohost.yml @@ -647,6 +647,19 @@ app: authenticate: all authenticator: ldap-anonymous + ### app_change_label() + change-label: + action_help: Change an application label + api: PUT /apps//label + configuration: + authenticate: all + authenticator: ldap-anonymous + arguments: + app: + help: the application id + new_label: + help: the new application label + ### app_addaccess() TODO: Write help addaccess: action_help: Grant access right to users (everyone by default) diff --git a/src/yunohost/app.py b/src/yunohost/app.py index 15855753c..9ccc0886d 100644 --- a/src/yunohost/app.py +++ b/src/yunohost/app.py @@ -1320,6 +1320,17 @@ def app_ssowatconf(auth): logger.success(m18n.n('ssowat_conf_generated')) +def app_change_label(auth, app, new_label): + installed = _is_installed(app) + if not installed: + raise MoulinetteError(errno.ENOPKG, + m18n.n('app_not_installed', app=app)) + + app_setting(app, "label", value=new_label) + + app_ssowatconf(auth) + + def _get_app_settings(app_id): """ Get settings of an installed app