From a8cf641ca22f83d8608e543e324794c718991483 Mon Sep 17 00:00:00 2001 From: kload Date: Sat, 28 Jun 2014 12:01:24 +0200 Subject: [PATCH] [enh] Add post_app_*access hooks --- app.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app.py b/app.py index 32d8efea9..3bb72ce02 100644 --- a/app.py +++ b/app.py @@ -538,6 +538,7 @@ def app_addaccess(auth, apps, users): """ from yunohost.user import user_list, user_info + from yunohost.hook import hook_callback if not users: users = [] @@ -577,6 +578,7 @@ def app_addaccess(auth, apps, users): new_users = new_users +','+ allowed_user app_setting(app, 'allowed_users', new_users.strip()) + hook_callback('post_app_addaccess', [app, new_users]) app_ssowatconf(auth) @@ -593,6 +595,7 @@ def app_removeaccess(auth, apps, users): """ from yunohost.user import user_list + from yunohost.hook import hook_callback remove_all = False if not users: @@ -628,6 +631,7 @@ def app_removeaccess(auth, apps, users): new_users=new_users+','+user['username'] app_setting(app, 'allowed_users', new_users.strip()) + hook_callback('post_app_removeaccess', [app, new_users]) app_ssowatconf(auth)