rls_multi_tenant 0.1.8 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3fb27124134b3487ef6f83347eca26c0ac64431e44a01d92cf70bd3dd5a03e20
4
- data.tar.gz: a4fceedb11cdc42c788aad2c8c8ac11f6344d497ec2f62b002719c7cfc5a6179
3
+ metadata.gz: b45cd6b953bae2321b231e78d3883eba2432803c44e036e4d6845269aef3633b
4
+ data.tar.gz: cf4f8900c3577c532fb82638a4064b239dd99611136b282560d06c6ba2e396bf
5
5
  SHA512:
6
- metadata.gz: adff1ce5bde6c15d358e67041982e0506c97fa5b1e7eee02fd69fbf9eab3799fa67be034a8b584ea8cf5864a556751d1d8a679e3adf49cddbedc995d988b98d7
7
- data.tar.gz: 0c125b52250a2fce049e4f0965af09c4ae13f75f8a7516b58f6a6d136179821471a2f7ff24340ba3654f2cfa1ec4bcf2af29d4ab76ddb58ddad2e3643edc5dbd
6
+ metadata.gz: eacdf26741563c4a9d4a25f6db59d55e1ebc8035f6804d4f19695178f9cf9da3bdd49e04f09173b33c4641a2ef3024987091250b4fc0d32a6736720ff56c1feb
7
+ data.tar.gz: 82257c569f87e8beff78a914ecfc0948a281835a10306e71ff8238ca71e403b25c32845ed7e710a2ef890eaa68ec9f525f130811c4c1a1bca6e1d4a3948028bd
@@ -23,9 +23,9 @@ class CreateAppUser < ActiveRecord::Migration[<%= Rails.version.to_f %>]
23
23
  execute "ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT, INSERT, UPDATE, DELETE ON TABLES TO #{app_user};"
24
24
  execute "ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT USAGE, SELECT ON SEQUENCES TO #{app_user};"
25
25
 
26
- # Grant permissions on system tables
27
- execute "GRANT SELECT ON TABLE schema_migrations TO #{app_user};"
28
- execute "GRANT SELECT ON TABLE ar_internal_metadata TO #{app_user};"
26
+ # Grant permissions on all existing tables
27
+ execute "GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA public TO #{app_user};"
28
+ execute "GRANT USAGE, SELECT ON ALL SEQUENCES IN SCHEMA public TO #{app_user};"
29
29
  end
30
30
 
31
31
  def down
@@ -35,6 +35,10 @@ class CreateAppUser < ActiveRecord::Migration[<%= Rails.version.to_f %>]
35
35
  execute "REVOKE ALL ON SCHEMA public FROM #{app_user};"
36
36
  execute "REVOKE CONNECT ON DATABASE #{ActiveRecord::Base.connection.current_database} FROM #{app_user};"
37
37
 
38
+ # Revoke permissions from all existing tables and sequences
39
+ execute "REVOKE ALL ON ALL TABLES IN SCHEMA public FROM #{app_user};"
40
+ execute "REVOKE ALL ON ALL SEQUENCES IN SCHEMA public FROM #{app_user};"
41
+
38
42
  # Revoke default permissions for future tables in public schema
39
43
  execute "ALTER DEFAULT PRIVILEGES IN SCHEMA public REVOKE SELECT, INSERT, UPDATE, DELETE ON TABLES FROM #{app_user};"
40
44
  execute "ALTER DEFAULT PRIVILEGES IN SCHEMA public REVOKE USAGE, SELECT ON SEQUENCES FROM #{app_user};"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RlsMultiTenant
4
- VERSION = "0.1.8"
4
+ VERSION = "0.1.9"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rls_multi_tenant
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Coding Ways