Created a generic method (AccessControlEntryToPermission) to handle the conversion of AccessControlEntry to Permission object and check the permission dynamically against ActionDefinition.Bit and removed duplicate handling per each SecurityNamespace.