Completely Locked out of website via User Permissions The story:

Here's the full story. I disabled the Drag 'n Drop uploads module and then I was prompted to rebuild user permissions. So I was like, Ok and I rebuilt the user permissions. Then I noticed I couldn't see my admin toolbar, so I scrolled down the list of modules and it was unchecked, so was almost everything else. I went through and rechecked the modules I needed and then I clicked save. Nothing happened so I decided I'd put my site in maintenance mode until I sorted out the problem (so I did). I couldn't figure out what was wrong or how to fix it so I restored my entire website from a backup made earlier (1:28 AM) today but now it's giving me an error and I can't even access my site.

The Error:

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'drupal.role' doesn't exist: SELECT r.rid, r.name, ur.uid FROM {role} r INNER JOIN {users_roles} ur ON ur.rid = r.rid WHERE ur.uid IN (:uids_0); Array ( [:uids_0] => 0 ) in UserController->attachLoad() (line 314 of ...public_html/modules/user/user.module).

The question:

Is there any way to fix this error?
It sounds like the roles database table got randomly deleted, which should basically never happen under the circumstances you describe.

If you have a recent database backup, I suggest you grab the structure and content of the roles table from that database backup and restore that to your site database so you have the right content.

If you don't have a backup, I suggest you do a new installation on a separate site (or your local computer) and then export JUST the roles table from that new installation and import the roles.