- also handle primary group of user when checking permissions

Pull request to supersede #100.