Workspace roles and item sharing decide who gets in. Fine-grained security decides what a person sees once inside. In Fabric the same idea (limit rows, columns, tables or files) is implemented in three places, and the right one depends on how the data is read.
Where each control lives
- SQL engine (warehouse and SQL analytics endpoint): row-level security through security policies, column-level security through
GRANT. They apply only to queries sent through T-SQL. - Semantic model: row-level and object-level security defined in model roles. They apply to users of the model and of reports built on it.
- OneLake security roles: control tables, folders, columns and rows at the storage level, for anyone reading through OneLake, including Spark.
A restriction in one place does not protect the data in another. A user who can read the files through Spark is not stopped by a T-SQL policy.
Row-level security in T-SQL
You write a predicate as an inline table-valued function and bind it to a table with a security policy. The predicate silently filters rows, so the user simply does not see them.
CREATE FUNCTION Security.tvf_securitypredicate(@SalesRep AS nvarchar(50))
RETURNS TABLE
WITH SCHEMABINDING
AS
RETURN SELECT 1 AS ok
WHERE @SalesRep = USER_NAME() OR USER_NAME() = 'manager@contoso.com';
GO
CREATE SECURITY POLICY SalesFilter
ADD FILTER PREDICATE Security.tvf_securitypredicate(SalesRep)
ON sales.Orders
WITH (STATE = ON);
Points to know: the filter affects SELECT, UPDATE and DELETE, but an INSERT still works. Each table needs its own policy, and tables without one return everything. Policies apply to all users including dbo, so admins who must see all rows need an exception in the predicate. Creating a policy needs ALTER ANY SECURITY POLICY plus ALTER on the schema. SCHEMABINDING = ON is the default and avoids extra permission checks on the predicate's dependencies.
Column-level security in T-SQL
You do not need a policy. Grant SELECT on the permitted columns only.
GRANT SELECT ON Customers(CustomerID, FirstName, LastName, Phone, Email)
TO [charlie@contoso.com];
A query that touches the hidden column, including SELECT *, fails with a permission-denied error. Granting to roles is easier to manage than granting to individuals, and only Microsoft Entra authentication is supported. Because the rule lives in the SQL layer, a Direct Lake report over the warehouse falls back to DirectQuery so the rule is respected.
Object-level security in a semantic model
OLS hides entire tables or columns, and even their metadata, from report viewers. It is part of a model role: for a table or column you set the metadata permission to none for that role. Users without access see a message that the field cannot be found. You can author it in the TMDL view or an external tool.
OneLake security (file, folder, table level)
OneLake security is a role-based, grant-only system on a lakehouse. It is deny by default, with no deny roles. Each role holds permissions (Read or ReadWrite), the tables, folders or schemas it covers, and members (users or groups).
- Securing a folder is how you protect unstructured files. Delta tables are folders too.
- Column and row rules can be added inside a role, but only for Delta Parquet or virtualized Iceberg tables. Row-level security cannot be set on non-table folders.
- Row and column rules must sit in one role. A user whose rows come from one role and columns from another gets query errors.
- ReadWrite only matters for Viewers, since Admin, Member and Contributor already write. A role with ReadWrite cannot include row or column rules.
- Admin, Member and Contributor are not restricted by these roles.
- A
DefaultReaderrole is created with each lakehouse for users with ReadAll. Delete it and those users lose access unless another role covers them. - With a restricted column,
select *in Spark returns the allowed columns, while the SQL analytics endpoint and semantic models return an error.
Choosing
- Only SQL users, rows by identity: T-SQL row-level security.
- Report viewers: model RLS or OLS.
- Spark and file access, or one rule everywhere: OneLake security.
Common mistakes
- Securing in T-SQL while people have Spark or file access.
- Forgetting that workspace Contributors bypass OneLake roles.
- Expecting RLS to block
INSERT.
For the exam
- RLS: filter predicate function plus
CREATE SECURITY POLICY; CLS: column-listGRANT. - OLS hides tables or columns in a semantic model; OneLake security secures files and folders.
- OneLake security grants only, deny by default.
- Row and column rules for one table must be in the same OneLake role.