permissions class finally works