I think, that code from pybb_editable_by filter we can move to this function, and than in filter just call it.