mikras_utils 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1c7d48444e75236d0188b539182a80aefeaea2770cdf7982188d7f055c8b552e
4
- data.tar.gz: 5d790361a1c314d7bda6013c1db9c904b50c81f3be39c8396d6c9e4da43e68bd
3
+ metadata.gz: 356975b3f96e8341dba97e96ca170a0fb181c3c8654bc874300144774094daba
4
+ data.tar.gz: 5cb71f7c6add1f89ca5025bcc9630a58474055516295e50d9ad6a2386cf6eb84
5
5
  SHA512:
6
- metadata.gz: 8e117ef1b45f0217ec14065d37405cf4b043259465c82a7df09caebc416a60ec15b80293c45c349ffb9cd0b9bd07fe8b9420b85e19f24a88a5dd62d3be62380f
7
- data.tar.gz: 285faf4c815810af7111d49176218401f86afc1568a915c721ee67787cbb11df2cd6c016bad9d7b33db61b6120d5726d65aa8e2f0d27fc4cfb06a5685f69de9f
6
+ metadata.gz: 74ba9b96d512f831d0dd1a691d1c6892447ac21f29fe91a1f62a5cd87dfefda93d95229c16ddd063ff6bfe3ae1782ea44bda0189eedf7cf757ee7ab5825e9497
7
+ data.tar.gz: 1d5a378eddd2900ef31cfcd908bdcdd4f780eaf89a162946bdf445429ef076a8fee43e2b5b7709f3fbc2852f166f43983a4b87064f59574674f64cded967e0de
@@ -101,7 +101,7 @@ module MkAcl
101
101
  case_roles = rule.roles.select { _1 == _1.upcase }
102
102
 
103
103
  if !auth_roles.empty?
104
- role_seq = conn.quote_value_seq(auth_roles)
104
+ role_seq = conn.quote_values(auth_roles)
105
105
  puts %(
106
106
  -- Find "#{action}" system role ACLs
107
107
  _acls := array[]::integer[];
@@ -114,7 +114,7 @@ module MkAcl
114
114
  end
115
115
 
116
116
  if !case_roles.empty?
117
- role_seq = conn.quote_value_seq(case_roles)
117
+ role_seq = conn.quote_values(case_roles)
118
118
  puts %(
119
119
  -- Find "#{action}" case role ACLs
120
120
  select _acls || array_agg(id)
@@ -151,8 +151,8 @@ module MkAcl
151
151
  # Insert a attach record per parent table. This snippet handles
152
152
  # multiple parents of a record but the check algorithm probably does
153
153
  # not TODO
154
- auth_role_list = conn.quote_value_seq table.insert.rules.map(&:auth_roles).flatten
155
- case_role_list = conn.quote_value_seq table.insert.rules.map(&:case_roles).flatten
154
+ auth_role_list = conn.quote_values table.insert.rules.map(&:auth_roles).flatten
155
+ case_role_list = conn.quote_values table.insert.rules.map(&:case_roles).flatten
156
156
  for parent in table.parents
157
157
  id_fields = conn.values %(select column_name from acl.links where table_name = '#{table}')
158
158
  for id_field in id_fields
@@ -30,7 +30,7 @@ module MkAcl
30
30
  meta.chains
31
31
  where src_schema_name = '#{app_schema}'
32
32
  and dst_schema_name = '#{app_schema}'
33
- and dst_table_name in #{conn.quote_value_list(DOMAIN_TABLES)}
33
+ and dst_table_name in (#{conn.quote_values(DOMAIN_TABLES)})
34
34
  )
35
35
 
36
36
  generate_per_table_id_functions
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MikrasUtils
4
- VERSION = "0.3.1"
4
+ VERSION = "0.3.2"
5
5
  end
@@ -1,8 +1,10 @@
1
1
 
2
+ drop function if exists public.current_role_ids() cascade;
3
+ drop function if exists public.current_domain_roles(integer) cascade;
4
+
2
5
  -- Returns an array of role IDs for the current user (from both auth and
3
6
  -- app_portal). This array is matched against the relevant ACL field in the RLS
4
7
  -- policies so performance is important (TODO)
5
- drop function if exists public.current_role_ids() cascade;
6
8
  create function public.current_role_ids() returns integer[] as $$
7
9
  select acl_portal.select_user_acl(public.current_user_id());
8
10
  $$ language sql
@@ -13,7 +15,6 @@ $$ language sql
13
15
 
14
16
  -- Returns an array of app_portal role names (kind) for the current user in the
15
17
  -- given domain
16
- drop function if exists public.current_domain_roles(integer) cascade;
17
18
  create function public.current_domain_roles(_domain_id integer) returns text[] as $$
18
19
  select coalesce(array_agg(dr.role), array[]::text[])
19
20
  from acl_portal.domain_users du
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mikras_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Claus Rasmussen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-07-15 00:00:00.000000000 Z
11
+ date: 2024-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pg_conn