Is it possible to filter the content of a t-sql view based on SELECT GRANTS assigned to the database roles of end users without generating SELECT permissions exceptions?
If so how?
Pseudo:
CREATE TABLE Beer(a(x), b(y)); GRANT SELECT ON Beer to BeerOnlyRole;
CREATE TABLE Wine(a(x), b(y)); GRANT SELECT ON Wine to WineAndBeerRole;
GRANT SELECT ON Beer to WineAndBeerRole;
CREATE VIEW SimpleAlcoholSearch
(
SELECT a AS BrandName
,b AS Strength
FROM Beer
UNION
SELECT a AS BrandName
,b AS Strength
FROM Wine
)
GRANT SELECT ON SimpleAlcoholSearch to BeerOnlyRole;
GRANT SELECT ON SimpleAlcoholSearch to WineAndBeerRole;
....
AS BeerOnlyRole : SELECT * FROM SimpleAlcoholSearch : BEER1 1% BEER2 2%
AS WineAndBeerRole : SELECT * FROM SimpleAlcoholSearch : BEER1 1% BEER2 2% WINE1 10% WINE2 11%
Thanks for reading this...