added a rudimental permissions checker