This is a very simple script that will create a table variable and fill it with all the users and roles permission for each object on all the databases (can be easily changed to get the permission of only one database or custom ones). The usage is really easy, just paste it on Management Studio and execute it.
The script creates three table variables (@dbs, @permission and @objects), one for storing the databases' names (@dbs), other to store the permission (@permission) and the third for storing the databases objects (@objects).
When the script runs, it will fill the @dbs with all the databases on the server, including snapshots. Then, it'll loop through the table, using the database name, to fill the @objects table. Finally, it'll join the @objects table with the sys.database_principals and sys.database_permissions to retrieve the permission and fill the @permission table. This operation will be performed on each database on the @dbs table. In case you want to get the permission for specific databases, just change the line that inserts the databases name from the sys.databases for the custom one.