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

DacFx shows permanent diff on some permissions if there was a grantor specified in the project sources #385

Open
IVNSTN opened this issue Jan 30, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@IVNSTN
Copy link

IVNSTN commented Jan 30, 2024

  • SqlPackage or DacFx Version:
    • SSDT - 16.0.62205.05200
    • SqlPackage - 162.0.52.1
  • .NET Framework (Windows-only) or .NET Core:
  • Environment (local platform and source/target platforms):
    • Windows 10
    • VS 2019

DacFx shows permanent diff on grantor option in permission definition if the permission is on user-defined type or schema. Other permissions (on sp or fn) are not affected by this bug. GRANT <whatever> ON SCHEMA::my_schema AS dbo is a valid syntax and should not produce any diff between project sources and target database.

Steps to Reproduce:

Minimal repro: permissions_diff.zip

  1. Deploy project from sources above to a new db
  2. Run "Schema compare" from sources to the db and back from db to sources, see no diff
  3. Uncomment AS dbo lines in permissions.sql
  4. Run "Schema compare" from sources to db - no diff, back from db to sources - see permanent diff which cannot be fixed by redeployment

Diff on schema permissions:
image

Diff on type permissions:
image

As a workaround we have a rule in our custom linter which prevents devs from defining grantor in permissions on types and schemas.

Did this occur in prior versions? If not - which version(s) did it work in?

If I'm not mistaken then in some of previous versions there was the same bug in forward-comparison from the project to DB but I have no proofs, unable to reproduce this behavior right now.

(DacFx/SqlPackage/SSMS/Azure Data Studio)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant