Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
canArchive() {
let canArchive = false;
let canSearch = false;
if (this.component && this.component instanceof Form) {
for (const field of this.component.getFields()) {
if (field instanceof CollectionField) {
canArchive =
!field.get('forbidViewArchived') &&
access.canArchive(field.get('form'));
canSearch = !field.get('forbidSearch');
}
}
}
return {
canArchive,
canSearch
};
}
canArchive() {
return access.canArchive(this.props.component.get('form'));
}