Fix passing permissions to command functions