upInCloud
upInCloud

Reputation: 999

SQL Server row level security on views

Does the row-level security (RLS) feature of SQL Server work with views? That is, can I define something on the lines of

CREATE SECURITY POLICY rls.SecPol  
    ADD FILTER PREDICATE rls.tenantAccessPredicate(TenantId) ON dbo.view_Sales

Where dbo.view_Sales is not a SQL Server table but a view?

I suppose this is not possible, though I couldn't find any existing documentation about this.

Upvotes: 0

Views: 1170

Answers (2)

sonia mawandia
sonia mawandia

Reputation: 55

Yes. Tried it. It works. Either everything has to be schemabound or for everything schemabinding has t

Upvotes: 1

Eric Munn
Eric Munn

Reputation: 580

Yes, with the caveat that the view must be schemabound.

Upvotes: 1

Related Questions