Fix canwrite permission when write is not specified