Open jzabroski opened 2 years ago
thx for looking at it. A few things pop up:
Where is this function going to be used?
Where is this function going to be used?
I use it to dump permissions to a file per role, so that permissions are independently managed from objects. It makes it easier to audit who-has-access-to-what rather than going to the bottom of every file-per-object to see each object's permissions.
In general, I find this a lot more useful that the server scripting support available today.
Can you add the wrapper method that walks the various object hierarchies and dumps the permission scripts generated from this method too? It could be a method on Server.
Can you add the wrapper method that walks the various object hierarchies and dumps the permission scripts generated from this method too? It could be a method on Server.
Yes.
Honestly, the way I manage security is extremely clean - there is only one thing bad with what I do in my whole process, which is that login tokens don't expire until the session ends, and the only way to force an update to a login token is to end the user's session. For AD Groups, I wish SQL Server had a refresh tokens stored proc call or a way to forcefully invalidate login tokens.
@shueybubbles I wrote this code awhile ago to integrate with SMO and overcome limitations in the built-in scripting engine (note the LOL). Can I get some initial feedback on how I can convert this into a PR? I am sure it's missing a bunch of edge cases.