Enterprise Manager Permissions

Enterprise Manager Permissions

  
Can anyone help me write a SQL Advanced Query using the Enterprise Manager tables which can select all the permissions for a user, regardless of whether they come from a Role, or as a directly assigned permission? I'm using the 4.0 version of Enterprise Manager.

Thanks

Ken