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

BREAKING CHANGE: SqlPermission: Refactor resource to have parameters Permission, PermissionToInclude, and PermissionToExclude #1773

Closed
johlju opened this issue Jul 28, 2022 · 0 comments · Fixed by #1778
Labels
breaking change When used on an issue, the issue has been determined to be a breaking change. enhancement The issue is an enhancement request.

Comments

@johlju
Copy link
Member

johlju commented Jul 28, 2022

I suggest the entire resource SqlPermission should be refactored to remove Ensure parameter. It should instead have the parameters Permission, PermissionToInclude, and PermissionToExclude. The PR #1769 has done such refactor on SqlDatabasePermission. I think we need to do a similar refactor on this resource.

Originally posted by @johlju in #1761 (comment)

@johlju johlju added enhancement The issue is an enhancement request. help wanted The issue is up for grabs for anyone in the community. breaking change When used on an issue, the issue has been determined to be a breaking change. labels Jul 28, 2022
@johlju johlju changed the title SqlPermission: Refactor resource to have parameters Permission, PermissionToInclude, and PermissionToExclude BREAKING CHANGE: SqlPermission: Refactor resource to have parameters Permission, PermissionToInclude, and PermissionToExclude Jul 28, 2022
@johlju johlju added in progress The issue is being actively worked on by someone. and removed help wanted The issue is up for grabs for anyone in the community. labels Jul 30, 2022
johlju added a commit that referenced this issue Jul 31, 2022
…urce) (#1778)

- SqlServerDsc
  - The following classes were added to the module:
    - `ServerPermission` - complex type for the DSC resource SqlPermission.
  - The following public functions were added to the module (see comment-based
    help for more information):
    - `Test-SqlDscIsLogin`
    - `ConvertFrom-SqlDscServerPermission`
    - `ConvertTo-SqlDscServerPermission`
    - `Get-SqlDscServerPermission`
    - `Set-SqlDscServerPermission`
  - SMO stubs (used in the unit tests)
    - Was updated to remove a bug related to the type `ServerPermissionInfo`
      when used with the type `ServerPermissionSet`. The stubs suggested that
      the property `PermissionType` (of type `ServerPermissionSet`)
      in `ServerPermissionInfo` should have been a array `ServerPermissionSet[]`.
      This conflicted with real SMO as it does not pass an array, but instead
      a single `ServerPermissionSet`. The stubs was modified to mimic the
      real SMO. At the same time some old mock code in the SMO stubs was removed
      as it was no longer in use.
- SqlPermission
  - BREAKING CHANGE: The resource has been refactored. The parameters
    `Permissions` has been replaced by parameters `Permission`,
    `PermissionToInclude`, and `PermissionToExclude`. These permissions
    parameters are now an instance of the type `ServerPermission`.
    The type `ServerPermission` contains two properties; `State` and
    `Permission`. This closes the issue [issue #1761](#1761),
    it also fixes the issues [issue #1773](#1773),
    [issue #1704](#1704),
    and [issue #752](#752).
  - The resource was refactored into a class-based resource.
- SqlDatabasePermission
  - Fixed comment-based help and cleaned up comments.
  - Fix localized string that referenced 'user' instead of 'principal',
    and correct localized string ID for each string.
- `Set-SqlDscDatabasePermission`
  - Minor code cleanup.
@johlju johlju removed the in progress The issue is being actively worked on by someone. label Aug 1, 2022
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. enhancement The issue is an enhancement request.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant