diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-20 02:18:09 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-20 02:18:09 +0300 |
commit | 6ed4ec3e0b1340f96b7c043ef51d1b33bbe85fde (patch) | |
tree | dc4d20fe6064752c0bd323187252c77e0a89144b /doc/development/import_export.md | |
parent | 9868dae7fc0655bd7ce4a6887d4e6d487690eeed (diff) |
Add latest changes from gitlab-org/gitlab@15-4-stable-eev15.4.0-rc42
Diffstat (limited to 'doc/development/import_export.md')
-rw-r--r-- | doc/development/import_export.md | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/doc/development/import_export.md b/doc/development/import_export.md index 6cbbb6bf716..c66ac0418ac 100644 --- a/doc/development/import_export.md +++ b/doc/development/import_export.md @@ -305,6 +305,29 @@ export_reorders: nulls_position: :nulls_last ``` +### Conditional export + +When associated resources are from outside the project, you might need to +validate that a user who is exporting the project or group can access these +associations. `include_if_exportable` accepts an array of associations for a +resource. During export, the `exportable_association?` method on the resource +is called with the association's name and user to validate if associated +resource can be included in the export. + +For example: + +```yaml +include_if_exportable: + project: + issues: + - epic_issue +``` + +This definition: + +1. Calls the issue's `exportable_association?(:epic_issue, current_user: current_user)` method. +1. If the method returns true, includes the issue's `epic_issue` association for the issue. + ### Import The import job status moves from `none` to `finished` or `failed` into different states: |