mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[enh] Add post_app_*access hooks
This commit is contained in:
parent
a92f7b8167
commit
a8cf641ca2
1 changed files with 4 additions and 0 deletions
4
app.py
4
app.py
|
@ -538,6 +538,7 @@ def app_addaccess(auth, apps, users):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
from yunohost.user import user_list, user_info
|
from yunohost.user import user_list, user_info
|
||||||
|
from yunohost.hook import hook_callback
|
||||||
|
|
||||||
if not users:
|
if not users:
|
||||||
users = []
|
users = []
|
||||||
|
@ -577,6 +578,7 @@ def app_addaccess(auth, apps, users):
|
||||||
new_users = new_users +','+ allowed_user
|
new_users = new_users +','+ allowed_user
|
||||||
|
|
||||||
app_setting(app, 'allowed_users', new_users.strip())
|
app_setting(app, 'allowed_users', new_users.strip())
|
||||||
|
hook_callback('post_app_addaccess', [app, new_users])
|
||||||
|
|
||||||
app_ssowatconf(auth)
|
app_ssowatconf(auth)
|
||||||
|
|
||||||
|
@ -593,6 +595,7 @@ def app_removeaccess(auth, apps, users):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
from yunohost.user import user_list
|
from yunohost.user import user_list
|
||||||
|
from yunohost.hook import hook_callback
|
||||||
|
|
||||||
remove_all = False
|
remove_all = False
|
||||||
if not users:
|
if not users:
|
||||||
|
@ -628,6 +631,7 @@ def app_removeaccess(auth, apps, users):
|
||||||
new_users=new_users+','+user['username']
|
new_users=new_users+','+user['username']
|
||||||
|
|
||||||
app_setting(app, 'allowed_users', new_users.strip())
|
app_setting(app, 'allowed_users', new_users.strip())
|
||||||
|
hook_callback('post_app_removeaccess', [app, new_users])
|
||||||
|
|
||||||
app_ssowatconf(auth)
|
app_ssowatconf(auth)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue