basic permissions support added (could be buggy)