DataObjectManager & Has Many File Manager - Limit # of entries?

I am building a site that contains many types of data, and I really like the way DataObjectManager handles working with data in the CMS. However, for some of my fields, the user is only able to upload a set number (or less) of a certain type of data.

For example - on a products page, the user may upload 4 or less (or none) videos per product.

How can I setup DataObjectManager to only allow for a fixed number of maximum inputs?

the approach posted by UncleCheese (modifying the $perms array) is nice, it has a serious usability downside though:
whenever you delete your latest object, you still can't add another one, as the permissions don't update. they DO update when you add another object though.

so: having 3 objects and 4 are allowed, and you add a 4th, the 'add' button disappears as intended.
but having 4 and deleting 1 won't result in the add button 'reappering' until you refresh the page.

Yeah, that makes sense. Although, you wouldn't have to refresh the entire page. You could just refresh the DataObjectManager itself. But I do see the issue. Deleting is the only action that does not refresh the entire DataObjectManager field.

could you set up dataobjectmanager to refresh after deleting an item / are there reasons not to do so?

i also got an somewhat related issue:
whenever i make some changes to an item in dataobjectmanager, and want to switch to another page, silverstripe brings up a javascript alert ('WARNING your changes have not been saved'), which is quite annoying, as changes have of course gracefully been saved by dataobjectmanager. is there a way to circumvent this?