How to use the @keystonejs/access-control.parseCustomAccess function in @keystonejs/access-control

To help you get started, we’ve selected a few @keystonejs/access-control 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 keystonejs / keystone / packages / keystone / lib / Keystone / index.js View on Github external
this.lists = {};
    this.listsArray = [];
    this.getListByKey = key => this.lists[key];
    this._extendedTypes = [];
    this._extendedQueries = [];
    this._extendedMutations = [];
    this._graphQLQuery = {};
    this._cookieSecret = cookieSecret;
    this._secureCookies = secureCookies;
    this._cookieMaxAge = cookieMaxAge;
    this._sessionStore = sessionStore;
    this.eventHandlers = { onConnect };
    this.registeredTypes = new Set();
    this._schemaNames = schemaNames;
    this.appVersion = appVersion;
    this.appVersion.access = parseCustomAccess({
      access: this.appVersion.access,
      schemaNames: this._schemaNames,
      defaultAccess: true,
    });

    if (adapters) {
      this.adapters = adapters;
      this.defaultAdapter = defaultAdapter;
    } else if (adapter) {
      this.adapters = { [adapter.constructor.name]: adapter };
      this.defaultAdapter = adapter.constructor.name;
    } else {
      throw new Error('No database adapter provided');
    }

    this.queryLimits = {
github keystonejs / keystone / packages / keystone / lib / Keystone / index.js View on Github external
const _parseAccess = obj => ({
      ...obj,
      access: parseCustomAccess({
        access: obj.access,
        schemaNames: this._schemaNames,
        defaultAccess: this.defaultAccess.custom,
      }),
    });

@keystonejs/access-control

KeystoneJS Access Control parsing and validating utilities.

MIT
Latest version published 3 years ago

Package Health Score

63 / 100
Full package analysis