SQL Create a report of user's privileges
===

I've a table where i store the privileges of the users to grant or denied access to the differents modules of the software.

    idUser     idModule
      1           1
      1           2
      1           3
      2           4

The user "1" has access to modules 1, 2, 3 but no 4.
The user "2" has access to 4 only.

So, the idModule is FK from Module table, if a user has access it will have a row in this table otherwise it will be denied.

    idModule           Module
       1          Can Create Users
       2          Can Edit Users
       3          Can Delete Users
       4          Can View Users

I'd like a query that output:

    idUser  Module1    Module2    Module3    Module4
      1        1          1          1          0
      2        0          0          0          1


This way is easy to do a report.

Thanks for reading.