Refactored: use a single function to apply an object's folded permissions to its main permissions