mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-18 04:51:35 +03:00
395de58c42
GitOrigin-RevId: 771491ec0cf6c0d860ef374ed67b426220fa2b96
174 lines
3.0 KiB
YAML
174 lines
3.0 KiB
YAML
type: bulk
|
|
args:
|
|
|
|
- type: pg_track_table
|
|
args:
|
|
table: employee
|
|
|
|
- type: pg_track_table
|
|
args:
|
|
table: team
|
|
|
|
- type: pg_track_table
|
|
args:
|
|
table: manager
|
|
|
|
#Object relationship
|
|
- type: pg_create_object_relationship
|
|
args:
|
|
name: manager
|
|
table: employee
|
|
using:
|
|
foreign_key_constraint_on: manager_id
|
|
|
|
#Array relationship
|
|
- type: pg_create_array_relationship
|
|
args:
|
|
table: manager
|
|
name: employees
|
|
using:
|
|
foreign_key_constraint_on:
|
|
table: employee
|
|
column: manager_id
|
|
|
|
- type: pg_add_computed_field
|
|
args:
|
|
table: employee
|
|
name: yearly_salary
|
|
definition:
|
|
function: employee_yearly_salary
|
|
table_argument: employee_row
|
|
|
|
- type: pg_create_select_permission
|
|
args:
|
|
table: employee
|
|
role: employee
|
|
permission:
|
|
columns:
|
|
- id
|
|
- name
|
|
- salary
|
|
- title
|
|
- team_id
|
|
computed_fields:
|
|
- yearly_salary
|
|
filter:
|
|
id:
|
|
_eq: X-Hasura-User-Id
|
|
|
|
- type: pg_create_select_permission
|
|
args:
|
|
table: employee
|
|
role: manager
|
|
permission:
|
|
columns:
|
|
- name
|
|
- title
|
|
- manager_remarks
|
|
filter:
|
|
manager_id:
|
|
_eq: X-Hasura-Manager-Id
|
|
allow_aggregations: true
|
|
|
|
- type: pg_create_select_permission
|
|
args:
|
|
table: manager
|
|
role: manager
|
|
permission:
|
|
columns: '*'
|
|
allow_aggregations: true
|
|
filter:
|
|
id: X-Hasura-Manager-Id
|
|
|
|
- type: pg_create_select_permission
|
|
args:
|
|
table: manager
|
|
role: employee
|
|
permission:
|
|
columns:
|
|
- name
|
|
- phone
|
|
allow_aggregations: true
|
|
filter:
|
|
employees:
|
|
manager_id:
|
|
_eq: X-Hasura-Manager-Id
|
|
|
|
- type: add_inherited_role
|
|
args:
|
|
role_name: manager_employee
|
|
role_set:
|
|
- manager
|
|
- employee
|
|
|
|
- type: pg_track_table
|
|
args:
|
|
table: authors
|
|
|
|
- type: pg_track_table
|
|
args:
|
|
table: articles
|
|
|
|
- type: pg_create_select_permission
|
|
args:
|
|
table: authors
|
|
role: author
|
|
permission:
|
|
columns:
|
|
- id
|
|
- name
|
|
- followers
|
|
allow_aggregations: false
|
|
filter:
|
|
id: X-Hasura-Author-Id
|
|
|
|
- type: pg_create_select_permission
|
|
args:
|
|
table: authors
|
|
role: editor
|
|
permission:
|
|
columns:
|
|
- name
|
|
- followers
|
|
allow_aggregations: true
|
|
filter: {}
|
|
|
|
- type: pg_create_select_permission
|
|
args:
|
|
table: articles
|
|
role: guest
|
|
permission:
|
|
columns:
|
|
- title
|
|
- content
|
|
- author_id
|
|
allow_aggregations: true
|
|
filter:
|
|
is_published: true
|
|
|
|
- type: pg_create_select_permission
|
|
args:
|
|
table: articles
|
|
role: author
|
|
permission:
|
|
columns: "*"
|
|
allow_aggregations: true
|
|
filter:
|
|
author_id: X-Hasura-Author-Id
|
|
|
|
- type: pg_create_select_permission
|
|
args:
|
|
table: articles
|
|
role: editor
|
|
permission:
|
|
columns: "*"
|
|
filter: {}
|
|
|
|
- type: add_inherited_role
|
|
args:
|
|
role_name: author_editor_guest_inherited_role
|
|
role_set:
|
|
- author
|
|
- editor
|
|
- guest
|