How to use the mson/lib/access.canArchive function in mson

To help you get started, we’ve selected a few mson examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github redgeoff / mson-react / src / app.js View on Github external
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
    };
  }
github redgeoff / mson-react / src / fields / collection-field.js View on Github external
canArchive() {
    return access.canArchive(this.props.component.get('form'));
  }