if [[ $UID == $(stat -c %u .) ]] && [[ -n $(stat -c %a . | grep -o '7[0-7][0-7]$') ]]; then
echo "you have permission, continuing"
elif [[ -n $(id -G| grep -ow $(stat -c %g .)) ]] && [[ -n $(stat -c %a . | grep -o '7[0-7]$') ]]; then
echo "you have permission, continuing"
elif [[ -n $(stat -c %a . | grep -o '7$') ]]; then
echo "you have permission, continuing"; else
echo "You do not have permission, please move to another directory"
exit 1
fi