Filter on permissions filters functions too

Fixes #695