changed the hasPerm method to checkPerm