Made sql backend work with roles.