How can I avoid repeating account permission requests in El Capitan?

On El Capitan my app shows repeating popups for account permission requests like calender or Twitter account access. I can reproduce this behaviour only on El Capitan but not on Yosemite or Mavericks. The permission does not appear in the security system settings either. Has the API changed for El Capitan? Or is this a Beta Bug?

I found the reason my code only worked in some cases. Apparently the account type can be different on different accounts (even on the same Mac). To get the desired account type, just get the value of Z_PK from the ZACCOUNTTYPE table where the ZIDENTIFIER matches your desired network, e.g. "com.apple.twitter", "com.apple.facebook" or "com.apple.sinaweibo". Then use the value for the insertion into the ZACCOUNTTYPE table.

How can I avoid repeating account permission requests in El Capitan?
 
 
Q