Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SqlPermission: Permission parameter should be mandatory #1762

Merged
merged 2 commits into from
Jul 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
the maximum memory is not specified.
- In a certain scenario the maximum memory would be enforced even if it was
not specified in the configuration.
- SqlPermission
- The `Permission` parameter is now mandatory for all `*-TargetResource`
([issue #1761](https://github.com/dsccommunity/SqlServerDsc/issues/1761)).
- SqlWindowsFirewall
- Now the variables in `Get-TargetResource` are correctly initialized so
they pass the new unit test that use strict mode.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function Get-TargetResource
[System.String]
$Principal,

[Parameter()]
[Parameter(Mandatory = $true)]
[ValidateSet('ConnectSql', 'AlterAnyAvailabilityGroup', 'ViewServerState', 'AlterAnyEndPoint')]
[System.String[]]
$Permission
Expand Down Expand Up @@ -140,7 +140,7 @@ function Set-TargetResource
[System.String]
$Principal,

[Parameter()]
[Parameter(Mandatory = $true)]
[ValidateSet('ConnectSql', 'AlterAnyAvailabilityGroup', 'ViewServerState', 'AlterAnyEndPoint')]
[System.String[]]
$Permission
Expand Down Expand Up @@ -238,7 +238,7 @@ function Test-TargetResource
[System.String]
$Principal,

[Parameter()]
[Parameter(Mandatory = $true)]
[ValidateSet('ConnectSql', 'AlterAnyAvailabilityGroup', 'ViewServerState', 'AlterAnyEndPoint')]
[System.String[]]
$Permission
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ class DSC_SqlPermission : OMI_BaseResource
[Write, Description("The host name of the _SQL Server_ to be configured. Default value is the current computer name.")] String ServerName;
[Write, Description("If the permission should be present or absent. Default value is `'Present'`."), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] String Ensure;
[Key, Description("The login to which permission will be set.")] String Principal;
[Write, Description("The permission to set for the login."), ValueMap{"ConnectSql","AlterAnyAvailabilityGroup","ViewServerState","AlterAnyEndPoint"}, Values{"ConnectSql","AlterAnyAvailabilityGroup","ViewServerState","AlterAnyEndPoint"}] String Permission[];
[Required, Description("The permission to set for the login."), ValueMap{"ConnectSql","AlterAnyAvailabilityGroup","ViewServerState","AlterAnyEndPoint"}, Values{"ConnectSql","AlterAnyAvailabilityGroup","ViewServerState","AlterAnyEndPoint"}] String Permission[];
};