Codesign dialog does not allow "accept"

Solution 1:

So, the cause of this problem seems to be a change in behaviour of El Capitan regarding virtual events (program-generated user input events), and not allowing them to generate keychain approval. I think the BetterTouchTool program is getting in the way here. The solution is either to disable BetterTouchTool or use the keyboard to click the button.

N.B. Apple have detailed this "fix" in the SecurityAgent section of https://support.apple.com/en-us/HT205375.

Solution 2:

SmoothMouse, in my case, was causing this. I just had to disable it temporarily to be able to click the Allow button.