allow recursive permission deleting and adding

also fix a minor permission adding match error