added define permissions to gen