-- name: GetPermissionsByUserID :many
SELECT DISTINCT p.name, p.description
FROM user_roles ur
JOIN role_permissions rp ON rp.role_id = ur.role_id
JOIN permissions p ON p.id = rp.permission_id
WHERE ur.user_id = sqlc.arg(user_id);
