diff --git a/.zprezto/abra/functions.zsh b/.zprezto/abra/functions.zsh index 50b8f1b..9ca856f 100644 --- a/.zprezto/abra/functions.zsh +++ b/.zprezto/abra/functions.zsh @@ -1,10 +1,8 @@ -function myfacl { +function reset_facl { FUNCTION_PRELUDE - if [[ ( -z $1 ) || ( -z $2 ) ]]; then - echo ':(' - return 1 - fi + : "${1:?user?}" + : "${2:?dirs?}" chown -R "${1}:${1}" "${@:2}" chmod -R u=rwX,g=rwX,o= "${@:2}" @@ -20,6 +18,20 @@ default:other::0\ " "${@:2}" } +function add_facl { + FUNCTION_PRELUDE + + : "${1:?user?}" + : "${2:?dirs?}" + + setfacl -Rm "\ +user:${1}:rwX,\ +default:user:${1}:rwX,\ +group:${1}:rwX,\ +default:group:${1}:rwX,\ +" "${@:2}" +} + function is_local { local HOSTNAME="$(hostname)"