Fix history actions permissions check

This PR fixes the permissions check in the history actions. Basically it's called later with the object as parameter.

This PR is on the 2.2 branch but I'm not sure it's still maintained, do I need to do it on the master branch ?