mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-17 02:51:45 -05:00
Add option to import permissions for dacfx extract (#1723)
* add option to import permissions for dacfx extract * change 'import' to 'include'
This commit is contained in:
@@ -26,6 +26,11 @@ namespace Microsoft.SqlTools.ServiceLayer.DacFx.Contracts
|
|||||||
/// Gets or sets the target for extraction
|
/// Gets or sets the target for extraction
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public DacExtractTarget ExtractTarget { get; set; }
|
public DacExtractTarget ExtractTarget { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets whether permissions should be included in the extract
|
||||||
|
/// </summary>
|
||||||
|
public bool? IncludePermissions { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ namespace Microsoft.SqlTools.ServiceLayer.DacFx
|
|||||||
public override void Execute()
|
public override void Execute()
|
||||||
{
|
{
|
||||||
Version version = ParseVersion(this.Parameters.ApplicationVersion);
|
Version version = ParseVersion(this.Parameters.ApplicationVersion);
|
||||||
DacExtractOptions extractOptions = GetExtractOptions(this.Parameters.ExtractTarget);
|
DacExtractOptions extractOptions = GetExtractOptions(this.Parameters.ExtractTarget, this.Parameters.IncludePermissions);
|
||||||
this.DacServices.Extract(this.Parameters.PackageFilePath, this.Parameters.DatabaseName, this.Parameters.ApplicationName, version, applicationDescription:null, tables:null, extractOptions:extractOptions, cancellationToken:this.CancellationToken);
|
this.DacServices.Extract(this.Parameters.PackageFilePath, this.Parameters.DatabaseName, this.Parameters.ApplicationName, version, applicationDescription:null, tables:null, extractOptions:extractOptions, cancellationToken:this.CancellationToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -41,9 +41,15 @@ namespace Microsoft.SqlTools.ServiceLayer.DacFx
|
|||||||
return parsedVersion;
|
return parsedVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
private DacExtractOptions GetExtractOptions(DacExtractTarget extractTarget)
|
private DacExtractOptions GetExtractOptions(DacExtractTarget extractTarget, bool? includePermissions)
|
||||||
{
|
{
|
||||||
DacExtractOptions extractOptions = new DacExtractOptions() { ExtractTarget = extractTarget };
|
DacExtractOptions extractOptions = new DacExtractOptions() { ExtractTarget = extractTarget };
|
||||||
|
|
||||||
|
if (includePermissions == true)
|
||||||
|
{
|
||||||
|
extractOptions.IgnorePermissions = false;
|
||||||
|
}
|
||||||
|
|
||||||
return extractOptions;
|
return extractOptions;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user