We have a need for observer to be able to view unpublished contents in the course. From my understanding only observer admin can do this but I only want to give permission only to that course.
Is there a way to do this?
The observer role is essentially the student role without the ability to submit anything. I think you're be better served looking at a "Teacher" role, with massively reduced permissions. That'll get them into the class prior to publishing so they can see everything, but you're still going to have to be careful about exposing student data once the course starts. We did this for some ADA reviewers in a few courses - we'd let them in with a teacher-based role, they'd do their review, then their enrollment in the course would be removed prior to the course starting.
Retrieving data ...