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

Issue in setting multiple DB roles for one SQL login with MSFT_xSQLServerDatabaseRole #108

Closed
sunbinzhu opened this issue Aug 15, 2016 · 7 comments
Labels
breaking change When used on an issue, the issue has been determined to be a breaking change. bug The issue is a bug.

Comments

@sunbinzhu
Copy link

sunbinzhu commented Aug 15, 2016

I met error when I use MSFT_xSQLServerDatabaseRole to grant db_owner role to one SQL login for multiple databases. For example, i want to grant UserA the db_owner role for DB1, DB2, DB3, i created 3 configuration items, with 'Name' as UserA, and 'Database' as DB1, DB2, DB3 separately. It failed to deploy because 'Name' is the only Key parameter for MSFT_xSQLServerDatabaseRole. And i had specified 3 items with same key but different values. Promoting parameter 'Database' as the second Key can fix this error.
My question is whether what i am doing is the correct way to grant multiple DB roles for one SQL login? If so I think you shall promote Database as Key as well. If not, please advise what is the correct way. Thanks.

@johlju
Copy link
Member

johlju commented Aug 15, 2016

You are correct. This seems to be a bug. Right now it only supports unique logins regardless of database.
DatabaseName is a [string] so it handles only one database per login as well. So a code fix need to be done to handle this.

@johlju
Copy link
Member

johlju commented Aug 15, 2016

This should be able to handle different instances on the same server as well

@sunbinzhu
Copy link
Author

And maybe make 'Role' as an array to grant multiple roles for one login?

@johlju
Copy link
Member

johlju commented Aug 15, 2016

That too. That would be a nice enhancement as well.

johlju added a commit to johlju/SqlServerDsc that referenced this issue Aug 18, 2016
@johlju
Copy link
Member

johlju commented Aug 18, 2016

@sunbinzhu and @typozh I have fixed this issue, but before I can PR I need to write a test for this resource. I will PR this weekend. But if you want to try it out you can find the fixed resource in my working branch in my fork of xSQLServer

@kwirkykat kwirkykat added bug The issue is a bug. in progress The issue is being actively worked on by someone. labels Aug 19, 2016
johlju added a commit to johlju/SqlServerDsc that referenced this issue Aug 20, 2016
johlju added a commit to johlju/SqlServerDsc that referenced this issue Aug 22, 2016
@johlju
Copy link
Member

johlju commented Aug 30, 2016

@kwirkykat Can you add breaking change tag to this issue?

@kwirkykat kwirkykat added the breaking change When used on an issue, the issue has been determined to be a breaking change. label Aug 30, 2016
johlju added a commit to johlju/SqlServerDsc that referenced this issue Aug 31, 2016
johlju added a commit to johlju/SqlServerDsc that referenced this issue Sep 11, 2016
johlju added a commit to johlju/SqlServerDsc that referenced this issue Sep 17, 2016
johlju added a commit to johlju/SqlServerDsc that referenced this issue Sep 21, 2016
johlju added a commit to johlju/SqlServerDsc that referenced this issue Sep 22, 2016
johlju added a commit to johlju/SqlServerDsc that referenced this issue Sep 23, 2016
johlju added a commit to johlju/SqlServerDsc that referenced this issue Oct 23, 2016
johlju added a commit to johlju/SqlServerDsc that referenced this issue Nov 8, 2016
johlju added a commit to johlju/SqlServerDsc that referenced this issue Nov 20, 2016
johlju added a commit to johlju/SqlServerDsc that referenced this issue Nov 27, 2016
johlju added a commit to johlju/SqlServerDsc that referenced this issue Nov 27, 2016
johlju added a commit that referenced this issue Nov 27, 2016
This resolves issue #99 and issue #108.
Added $script scope to currentPath variable
Fixed style to align with the style guide
Set-method did not throw on error
Added test for the resource xSQLServerDatabaseRole
Changes to en-US strings. Resolved that backspace was not escaped. Now it shows a backspace between server and instance in messages.
@johlju
Copy link
Member

johlju commented Nov 27, 2016

This issue was resolved in merged PR #115. Let us know if there is any further problems.

@johlju johlju closed this as completed Nov 27, 2016
@johlju johlju removed the in progress The issue is being actively worked on by someone. label Nov 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change When used on an issue, the issue has been determined to be a breaking change. bug The issue is a bug.
Projects
None yet
Development

No branches or pull requests

3 participants