implement permissions
adapt tests