SET ROWFILTER

From Lianjapedia
Revision as of 12:24, 23 February 2017 by Yvonne.milne (Talk | contribs)

Jump to: navigation, search

Purpose

Enable/disable row filters or set a row filter for the current table

Syntax

SET ROWFILTER TO [<condition>]

SET ROWFILTER ON | OFF | (<expL>)

See Also

DATAMASK(), FILTER(), MD5(), ROWFILTER(), SET FILTER, SYSDATAMASKS, SYSPERMS, SYSROLES, SYSROWFILTERS, System Tables, Users and Roles, Guide to the Users Workspace (Video)

Description

If SET ROWFILTER TO <condition> is specified, records that do not satisfy the specified <condition> are automatically secluded. If SET ROWFILTER TO is specified, without a <condition>, the current row filter is removed allowing all records to be accessed. The SET ROWFILTER command enables or disables row filters. By default, ROWFILTER is OFF.

This allows for the testing of authenticated user Row level Security (RLS) row filters.

Supported from Lianja v3.4.

Example

open database southwind
use customers
set rowfilter on
set rowfilter to country = "Germany"
// List records where country = "Germany"
list
set rowfilter off
// List all records
list
set rowfilter to country = "Mexico"
// List records where country = "Mexico"
list
set rowfilter to
// List all records
list