helpers 2.1: remove legacy ynh_legacy_permissions_exists and ynh_legacy_permissions_delete_all

This commit is contained in:
Alexandre Aubin 2024-05-27 23:43:35 +02:00
parent 84a7b23e8a
commit 88684c7937

View file

@ -358,41 +358,3 @@ ynh_permission_has_user() {
return 1
}
# Check if a legacy permissions exist
#
# [packagingv1]
#
# usage: ynh_legacy_permissions_exists
# | exit: Return 1 if the permission doesn't exist, 0 otherwise
#
# Requires YunoHost version 4.1.2 or higher.
ynh_legacy_permissions_exists() {
for permission in "skipped" "unprotected" "protected"; do
if ynh_permission_exists --permission="legacy_${permission}_uris"; then
return 0
fi
done
return 1
}
# Remove all legacy permissions
#
# [packagingv1]
#
# usage: ynh_legacy_permissions_delete_all
#
# example:
# if ynh_legacy_permissions_exists
# then
# ynh_legacy_permissions_delete_all
# # You can recreate the required permissions here with ynh_permission_create
# fi
# Requires YunoHost version 4.1.2 or higher.
ynh_legacy_permissions_delete_all() {
for permission in "skipped" "unprotected" "protected"; do
if ynh_permission_exists --permission="legacy_${permission}_uris"; then
ynh_permission_delete --permission="legacy_${permission}_uris"
fi
done
}