HABTM or has_many through

I am working on an application that has the following tables:

District
Building
User
Role

What I am trying to accomplish is:

There are many buildings per district
There are many users per district
There are many users per building
Each user has one role per building
Each user has one role per district

I am still learning rails so I am not sure what is the proper way to
approach this…

Can anyone assist me in the correct way to define this?

John