-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ [#4650] Add option to skip ownership checks to options UI
- Loading branch information
1 parent
cd450ed
commit 34647c5
Showing
3 changed files
with
59 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
...forms/js/components/admin/form_design/variables/prefill/objects_api/SkipOwnershipCheck.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import {useField} from 'formik'; | ||
import {FormattedMessage} from 'react-intl'; | ||
|
||
import FormRow from 'components/admin/forms/FormRow'; | ||
import {Checkbox} from 'components/admin/forms/Inputs'; | ||
|
||
const SkipOwnershipCheck = () => { | ||
const [fieldProps] = useField({name: 'options.skipOwnershipCheck', type: 'checkbox'}); | ||
return ( | ||
<FormRow> | ||
<Checkbox | ||
label={ | ||
<FormattedMessage | ||
description="Objects API registration: skipOwnershipCheck label" | ||
defaultMessage="Skip ownership check" | ||
/> | ||
} | ||
helpText={ | ||
<FormattedMessage | ||
description="Objects API registration: skipOwnershipCheck helpText" | ||
defaultMessage={`If enabled, then no access control on the referenced object is performed. | ||
Ensure that it does not contain private data before checking this! | ||
`} | ||
/> | ||
} | ||
{...fieldProps} | ||
/> | ||
</FormRow> | ||
); | ||
}; | ||
|
||
SkipOwnershipCheck.propTypes = {}; | ||
|
||
export default SkipOwnershipCheck; |