by slashrsm: Add permissions callback class.
by slashrsm: Fix tests.