I had an sql query that returned the user information, joining his permissions with another table that had his role permissions registered:
SELECT U.*, array_