DENY Availability Group Permissions (Transact-SQL)
Denies permissions on an AlwaysOn availability group.
Permissions at the server scope can be denied only when the current database is master.
Information about availability groups is visible in the sys.availability_groups (Transact-SQL) catalog view. Information about server permissions is visible in the sys.server_permissions catalog view, and information about server principals is visible in the sys.server_principals catalog view.
An availability group is a server-level securable. The most specific and limited permissions that can be denied on an availability group are listed in the following table, together with the more general permissions that include them by implication.
|
Availability group permission |
Implied by availability group permission |
Implied by server permission |
|---|---|---|
|
ALTER |
CONTROL |
ALTER ANY AVAILABILITY GROUP |
|
CONNECT |
CONTROL |
CONTROL SERVER |
|
CONTROL |
CONTROL |
CONTROL SERVER |
|
TAKE OWNERSHIP |
CONTROL |
CONTROL SERVER |
|
VIEW DEFINITION |
CONTROL |
VIEW ANY DEFINITION |
A. Denying VIEW DEFINITION permission on an availability group
The following example denies VIEW DEFINITION permission on availability group MyAg to SQL Server login ZArifin.
USE master; DENY VIEW DEFINITION ON AVAILABILITY GROUP::MyAg TO ZArifin; GO
B. Denying TAKE OWNERSHIP permission with the CASCADE OPTION
The following example denies TAKE OWNERSHIP permission on availability group MyAg to SQL Server user PKomosinski with the CASCADE option.
USE master;
DENY TAKE OWNERSHIP ON AVAILABILITY GROUP::MyAg TO PKomosinski
CASCADE;
GO