SqlDatabaseObjectPermission: Fails to compile when granting select and execute on different objects. #1724
Labels
breaking change
When used on an issue, the issue has been determined to be a breaking change.
bug
The issue is a bug.
Problem description
When compiling a DSC configuration with two
SqlDatabaseObjectPermission
resources, I receive the error messageI'm using grants of different permission types on different objects. For example, if I try to grant execute to a procedure and select to a table in the same configuration, I receive the error above. If I only grant a single permission type, the error is not generated. This only occurs when different permissions are granted in the same configuration.
Verbose logs
DSC configuration
Suggested solution
Change the definition of the class
DSC_DatabaseObjectPermission
in the fileDSC_SqlDatabaseObjectPermission.schema.mof
to make the Permission property a key and remove the array from this property.Change the parameter
$Permission
ofConvertTo-CimDatabaseObjectPermission
to remove the array in DSC_SqlDatabaseObjectPermission.psm1 to align with the updated class definition.Note: This would be a breaking change in that each permission will need to be defined individually.
SQL Server edition and version
SQL Server PowerShell modules
Operating system
PowerShell version
SqlServerDsc version
The text was updated successfully, but these errors were encountered: