2019-10-18 11:29:47 +03:00
|
|
|
- description: Add a computed field get_articles to author table
|
|
|
|
url: /v1/query
|
|
|
|
status: 200
|
|
|
|
query:
|
|
|
|
type: add_computed_field
|
|
|
|
args:
|
|
|
|
table: author
|
|
|
|
name: get_articles
|
|
|
|
definition:
|
|
|
|
function: fetch_articles
|
|
|
|
table_argument: author_row
|
|
|
|
response:
|
|
|
|
message: success
|
|
|
|
|
|
|
|
- description: Add a computed field full_name to author table
|
|
|
|
url: /v1/query
|
|
|
|
status: 200
|
|
|
|
query:
|
|
|
|
type: add_computed_field
|
|
|
|
args:
|
|
|
|
table: author
|
|
|
|
name: full_name
|
|
|
|
definition:
|
|
|
|
function: full_name
|
|
|
|
response:
|
|
|
|
message: success
|
|
|
|
|
|
|
|
- description: Create select permission with non existed computed fields
|
|
|
|
url: /v1/query
|
|
|
|
status: 400
|
|
|
|
query:
|
|
|
|
type: create_select_permission
|
|
|
|
args:
|
|
|
|
table: author
|
|
|
|
role: user
|
|
|
|
permission:
|
|
|
|
columns: '*'
|
|
|
|
computed_fields:
|
|
|
|
- full_name
|
|
|
|
- random
|
|
|
|
filter: {}
|
|
|
|
response:
|
2019-11-27 01:49:42 +03:00
|
|
|
internal:
|
|
|
|
- definition:
|
|
|
|
role: user
|
2020-12-28 15:56:00 +03:00
|
|
|
source: default
|
2019-11-27 01:49:42 +03:00
|
|
|
comment:
|
|
|
|
permission:
|
|
|
|
allow_aggregations: false
|
|
|
|
computed_fields:
|
|
|
|
- full_name
|
|
|
|
- random
|
|
|
|
columns: '*'
|
|
|
|
filter: {}
|
2019-12-16 20:10:02 +03:00
|
|
|
table:
|
|
|
|
schema: public
|
|
|
|
name: author
|
2021-05-19 08:01:54 +03:00
|
|
|
reason: 'Inconsistent object: in table "author": in permission for role "user":
|
|
|
|
computed field "random" does not exist'
|
|
|
|
name: select_permission user in table author in source default
|
2019-11-27 01:49:42 +03:00
|
|
|
type: select_permission
|
|
|
|
path: $.args
|
2021-05-19 08:01:54 +03:00
|
|
|
error: 'Inconsistent object: in table "author": in permission for role "user": computed
|
|
|
|
field "random" does not exist'
|
|
|
|
code: invalid-configuration
|
2019-11-27 01:49:42 +03:00
|
|
|
- description: Create select permission with computed field which returns a set of
|
|
|
|
table
|
2019-10-18 11:29:47 +03:00
|
|
|
url: /v1/query
|
|
|
|
status: 400
|
|
|
|
query:
|
|
|
|
type: create_select_permission
|
|
|
|
args:
|
|
|
|
table: author
|
|
|
|
role: user
|
|
|
|
permission:
|
|
|
|
columns: '*'
|
|
|
|
computed_fields:
|
|
|
|
- full_name
|
|
|
|
- get_articles
|
|
|
|
filter: {}
|
|
|
|
response:
|
2019-11-27 01:49:42 +03:00
|
|
|
internal:
|
|
|
|
- definition:
|
|
|
|
role: user
|
2020-12-28 15:56:00 +03:00
|
|
|
source: default
|
2019-11-27 01:49:42 +03:00
|
|
|
comment:
|
|
|
|
permission:
|
|
|
|
allow_aggregations: false
|
|
|
|
computed_fields:
|
|
|
|
- full_name
|
|
|
|
- get_articles
|
|
|
|
columns: '*'
|
|
|
|
filter: {}
|
2019-12-16 20:10:02 +03:00
|
|
|
table:
|
|
|
|
schema: public
|
|
|
|
name: author
|
2021-05-19 08:01:54 +03:00
|
|
|
reason: 'Inconsistent object: in table "author": in permission for role "user":
|
|
|
|
select permissions on computed field "get_articles" are auto-derived from the
|
|
|
|
permissions on its returning table "article" and cannot be specified manually'
|
|
|
|
name: select_permission user in table author in source default
|
2019-11-27 01:49:42 +03:00
|
|
|
type: select_permission
|
|
|
|
path: $.args
|
2021-05-19 08:01:54 +03:00
|
|
|
error: 'Inconsistent object: in table "author": in permission for role "user": select
|
|
|
|
permissions on computed field "get_articles" are auto-derived from the permissions
|
|
|
|
on its returning table "article" and cannot be specified manually'
|
|
|
|
code: invalid-configuration
|
2019-10-18 11:29:47 +03:00
|
|
|
- description: Create select permission on article table
|
|
|
|
url: /v1/query
|
|
|
|
status: 200
|
|
|
|
query:
|
|
|
|
type: create_select_permission
|
|
|
|
args:
|
|
|
|
table: article
|
|
|
|
role: user
|
|
|
|
permission:
|
|
|
|
columns: '*'
|
|
|
|
filter: {}
|
|
|
|
response:
|
|
|
|
message: success
|
|
|
|
|
|
|
|
- description: Create select permission with computed fields on author table
|
|
|
|
url: /v1/query
|
|
|
|
status: 200
|
|
|
|
query:
|
|
|
|
type: create_select_permission
|
|
|
|
args:
|
|
|
|
table: author
|
|
|
|
role: user
|
|
|
|
permission:
|
|
|
|
columns: '*'
|
|
|
|
computed_fields:
|
|
|
|
- full_name
|
|
|
|
filter: {}
|
|
|
|
response:
|
|
|
|
message: success
|
|
|
|
|
|
|
|
- description: Try to drop a computed field defined in permission
|
|
|
|
url: /v1/query
|
|
|
|
status: 400
|
|
|
|
query:
|
|
|
|
type: drop_computed_field
|
|
|
|
args:
|
|
|
|
table: author
|
2019-11-07 17:39:48 +03:00
|
|
|
name: full_name
|
2019-10-18 11:29:47 +03:00
|
|
|
response:
|
2019-11-27 01:49:42 +03:00
|
|
|
path: $.args
|
2020-12-28 15:56:00 +03:00
|
|
|
error: 'cannot drop due to the following dependent objects : permission author.user.select
|
|
|
|
in source "default"'
|
2019-10-18 11:29:47 +03:00
|
|
|
code: dependency-error
|
|
|
|
- description: Drop a computed field with cascade
|
|
|
|
url: /v1/query
|
|
|
|
status: 200
|
|
|
|
query:
|
|
|
|
type: drop_computed_field
|
|
|
|
args:
|
|
|
|
table: author
|
2019-11-07 17:39:48 +03:00
|
|
|
name: full_name
|
2019-10-18 11:29:47 +03:00
|
|
|
cascade: true
|
|
|
|
response:
|
|
|
|
message: success
|
|
|
|
|
|
|
|
- description: Drop a computed field
|
|
|
|
url: /v1/query
|
|
|
|
status: 200
|
|
|
|
query:
|
|
|
|
type: drop_computed_field
|
|
|
|
args:
|
|
|
|
table: author
|
2019-11-07 17:39:48 +03:00
|
|
|
name: get_articles
|
2019-10-18 11:29:47 +03:00
|
|
|
response:
|
|
|
|
message: success
|