SELECT users.name, permissions.name perm from users
inner join user_roles
on users.user_id=user_roles.user_fk
inner join roles
on roles.role_id=user_roles.role_fk
inner join role_permissions
on roles.role_id=role_permissions.role_fk
inner join permissions
on permissions.permission_id=role_permissions.permission_fk
having users.name='Ivan' and perm='auth-site'