Module: PgRls::ActiveRecord::ConnectionAdapters::PostgreSQL::GrantRlsUserPrivileges

Includes:
SqlHelperMethod
Defined in:
lib/pg_rls/active_record/connection_adapters/postgre_sql/grant_rls_user_privileges.rb

Overview

This module contains the logic to grant user privileges

Instance Method Summary collapse

Instance Method Details

#grant_rls_user_privileges(schema = PgRls.schema, role_name = PgRls.rls_role_group) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/pg_rls/active_record/connection_adapters/postgre_sql/grant_rls_user_privileges.rb', line 11

def grant_rls_user_privileges(schema = PgRls.schema, role_name = PgRls.rls_role_group)
  grant_schema_usage(schema, role_name)
  grant_schema_migration_table_privileges(schema, role_name)
  grant_default_sequence_privileges(schema, role_name)
  grant_default_table_privileges(schema, role_name)
  grant_existing_table_privileges(schema, role_name)
  grant_existing_sequence_privileges(schema, role_name)
end

#revoke_rls_user_privileges(schema = PgRls.schema, role_name = PgRls.rls_role_group) ⇒ Object



20
21
22
23
24
25
26
27
# File 'lib/pg_rls/active_record/connection_adapters/postgre_sql/grant_rls_user_privileges.rb', line 20

def revoke_rls_user_privileges(schema = PgRls.schema, role_name = PgRls.rls_role_group)
  revoke_schema_usage(schema, role_name)
  revoke_schema_migration_table_privileges(schema, role_name)
  revoke_default_sequence_privileges(schema, role_name)
  revoke_default_table_privileges(schema, role_name)
  revoke_existing_table_privileges(schema, role_name)
  revoke_existing_sequence_privileges(schema, role_name)
end