SqlDatabaseRole: Conflict when assigning both present and absent roles for same user #1339
Labels
breaking change
When used on an issue, the issue has been determined to be a breaking change.
bug
The issue is a bug.
Details of the scenario you tried and the problem that is occurring
I want to configure a database and ensure a group of users only have read access. I want to ensure a user is present in the db_datareader role AND is absent from the db_datawriter role.
There is a key property constraint preventing both Present and Absent roles.
How do I configure a database to ensure users only have the db_datareader role?
Verbose logs showing the problem
Suggested solution to the issue
Add Ensure as a key property so you can specify both Present and Absent roles?
Modify SqlDatabaseRole so that when you ensure a user is present on specified roles it automatically ensures the user is absent on all other roles? (yuk hidden dependencies)
The DSC configuration that is used to reproduce the issue (as detailed as possible)
SQL Server edition and version the target node is running
Microsoft SQL Server 2017 (RTM-CU5) (KB4092643) - 14.0.3023.8 (X64) Mar 2 2018 18:24:44 Copyright (C) 2017 Microsoft Corporation Developer Edition (64-bit) on Windows Server 2016 Datacenter 10.0 (Build 14393: ) (Hypervisor)
SQL Server PowerShell modules present on the target node
The operating system the target node is running
Version and build of PowerShell the target node is running
5.1.14393.2248
Version of the DSC module that was used ('dev' if using current dev branch)
The text was updated successfully, but these errors were encountered: