Permissions wiping themselves I have a weird problem and was hoping maybe someone on this community experienced it before or would know a better way to debug the issue.

I help manage a large group of multi-sites in Drupal 7.52. There are currently 9 websites and thousands of nodes, so its not a tiny system. we have 13 roles (including the basic - 6 are custom).

Two of these roles are checked to see "View Interactive Information Bar". Description of this permission is "Allow users to view the IIB. This may allow users to perform administrative tasks.".

There are a bunch more but I will use the above as the example to the issue. We will go say 2-3 weeks with no issues and then all of a sudden this permission will become un-checked ONLY for our custom roles. This applies to a bunch of other permissions as well, what is odd is its not ALL the permissions. It is only a few and they keep repeating, the above permission is one. 

I will go in and check it back on, it will be fine for a day and then boom, unchecked again. I will repeat this for maybe 2-3 days and then it will be fine for weeks. 

I've checked the logs, error logs etc... and nothing is coming up. I've tried checking CRON to see if it happens when CRON runs but nothing. It almost seems random.

Has anyone ever come across this before? Or know of a way to possibly debug this?

Thanks!
To debug, add a user update hook and check if they role is being unchecked, then log the $edit to your watchdog log then you should be able to see who/what is causing this change. This is a very rough example and you'd have to customize it to fit your roles etc.

function YOURMODULE_user_update(&amp;$edit, $account, $category) {
   if (user_has_role($YOUR_ROLE_RID, $account) {
     debug($account, 'account', true);
     debug($edit, 'edit request', true);
     // maybe add an email notification letting you know the event fired
   }
}


You can then test it by manually disabling that role and see if the debug messages appear in your log. Then if it works, just wait and see what happens when the mysterious permissions troll strikes again.