I've been tasked to write a module to allow external systems to check if a given user can submit a particular webform. I'm basically checking node_access and whether the specified user has passed their submission limit.
To do so I've had to modify the function signature for
_webform_submission_limit_check($node, $account = NULL);. I was thinking, why not just change it to a regular function other modules can use?
Make it into
webform_submission_limit_check($node, $account = NULL);
The extra variable would allow you to check any user's submission limit. Of course the proper access controls would need to be added in as well ( tie in access all webform results and access own webform results).
P.S. I can submit the patch if you'd like to see (once I'm done, have to run through the permission checks to ensure I haven't exposed any data unknowingly)