How to ignore grant permission within schema change
Schema file tend to have the creation of the schema with grant permissions of that schema to users.
But if we filter out users, how can we filter out the grant permission to those users within the schema file?
-- example ... how does one filter/ignore the grant line so readyroll doesn't detect these changes?
But if we filter out users, how can we filter out the grant permission to those users within the schema file?
-- example ... how does one filter/ignore the grant line so readyroll doesn't detect these changes?
CREATE SCHEMA [test] -- schema exists in all regions
AUTHORIZATION [dbo]
GO
GRANT DELETE ON SCHEMA:: [test] TO [domain\test_user] -- user only exists in dev region
GO
Tagged:
Best Answer
-
dnlnln Posts: 234 Gold 2You can ignore all user permissions, as role memberships that include users, by adding the following to your ProjectName.sqlproj file under the <Project> element:
<div><PropertyGroup> <SyncOptionIgnoreUsersPermissionsAndRoleMemberships>True</SyncOptionIgnoreUsersPermissionsAndRoleMemberships> <span style="background-color: transparent; color: inherit; font-size: inherit; font-family: Roboto, "Helvetica Neue", Arial, sans-serif;"></PropertyGroup></span></div>
When you next import your database, such permissions & memberships will be excluded from the generated migrations
For more information, see Key concepts > Configuring comparison & script generation options.Daniel Nolan
Product Manager
Redgate Software
Answers
Thanks for your post.
If you don't receive a response from the community and you have a support contract you can always send us a ticket so that a product specialist can help you with your issue.
Kind regards
Richard Lynch.
Redgate Software