After restoring, sometimes I found that I have a user in the database, but it’s not linked to a global user. Found this to work:
sp_change_users_login ‘auto_fix’, ‘SOME_USER’
Oh yeah – I first created the user under the top-most Security folder and then ran this on the specific database.
Found it here.