Setting correct permission in patch