helpers2.1: switch to posisional args for ynh_multimedia_addaccess because that's what 99% of apps already do

This commit is contained in:
Alexandre Aubin 2024-07-01 18:24:58 +02:00
parent 40a3205add
commit ef622ffe4d

View file

@ -78,19 +78,12 @@ ynh_multimedia_addfolder() {
setfacl -RL -m m::rwx "$source_dir"
}
# Allow an user to have an write authorisation in multimedia directories
# Add an user to the multimedia group, in turn having write permission in multimedia directories
#
# usage: ynh_multimedia_addaccess user_name
#
# | arg: --user_name= - The name of the user which gain this access.
# | arg: user_name - The name of the user which gain this access.
ynh_multimedia_addaccess() {
# ============ Argument parsing =============
local -A args_array=([u]=user_name=)
local user_name
ynh_handle_getopts_args "$@"
# ===========================================
groupadd -f multimedia
usermod -a -G multimedia $user_name
usermod -a -G multimedia $1
}