mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Merge branch 'dev' of https://github.com/YunoHost/yunohost into dev
This commit is contained in:
commit
2b638fc87d
2 changed files with 13 additions and 4 deletions
|
@ -6,8 +6,8 @@
|
|||
|
||||
<div align="center">
|
||||
|
||||
[](https://travis-ci.org/YunoHost/yunohost)
|
||||
[](https://github.com/YunoHost/yunohost/blob/stretch-unstable/LICENSE)
|
||||
[](https://gitlab.com/yunohost/yunohost/-/pipelines)
|
||||
[](https://github.com/YunoHost/yunohost/blob/dev/LICENSE)
|
||||
[](https://mastodon.social/@yunohost)
|
||||
|
||||
</div>
|
||||
|
|
|
@ -362,8 +362,17 @@ ynh_permission_has_user() {
|
|||
return 1
|
||||
fi
|
||||
|
||||
yunohost user permission info "$app.$permission" --output-as json --quiet \
|
||||
| jq -e --arg user $user '.corresponding_users | index($user)' >/dev/null
|
||||
# Check both allowed and corresponding_users sections in the json
|
||||
for section in "allowed" "corresponding_users"
|
||||
do
|
||||
if yunohost user permission info "$app.$permission" --output-as json --quiet \
|
||||
| jq -e --arg user $user --arg section $section '.[$section] | index($user)' >/dev/null
|
||||
then
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
# Check if a legacy permissions exist
|
||||
|
|
Loading…
Add table
Reference in a new issue