Skip to contents

Construct a row level security policy

Usage

rls_construct_policy(
  name,
  on,
  as = NULL,
  for_ = NULL,
  to = NULL,
  using = NULL,
  with = NULL
)

Arguments

name

(character) the policy name. required

on

(character) the table to apply the policy to. required

as

(character) permissive (default) or restrictive. permissive combines with "OR" while restrictive combines with "AND"

for_

(character) permissive (default) or restrictive.

to

(character) The role(s) to which the policy is to be applied. The default is PUBLIC, which will apply the policy to all roles.

using

(character) Specifies a filter that is applied to the WHERE clause of a query

with

(character) the check condition

Value

s3 object of class rls_policy_redshift

Examples

x <- rls_construct_policy(
  name = "hide_confidential",
  on = "sometable",
  with = "confidential BOOLEAN",
  using = "confidential = false"
)
x
#> <rls_policy>
#>   policy name: hide_confidential
#>   on: sometable
#>   using: confidential = false
#>   with: confidential BOOLEAN