Allow nested calls to switch function, check perms when copying a folder