How to use the @webiny/app-security.hasScopes function in @webiny/app-security

To help you get started, we’ve selected a few @webiny/app-security 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 webiny / webiny-js / packages / app-security / src / components / SecureView.js View on Github external
export default ({ children, scopes, roles }: Object): React.Node => {
    const checks = {
        scopes: scopes ? hasScopes(scopes) : true,
        roles: roles ? hasRoles(roles) : true
    };

    if (typeof children === "function") {
        return children(checks);
    }

    return checks.scopes && checks.roles ? children : null;
};

@webiny/app-security

[![](https://img.shields.io/npm/dw/@webiny/app-security.svg)](https://www.npmjs.com/package/@webiny/app-security) [![](https://img.shields.io/npm/v/@webiny/app-security.svg)](https://www.npmjs.com/package/@webiny/app-security) [![code style: prettier](ht

MIT
Latest version published 19 days ago

Package Health Score

80 / 100
Full package analysis

Similar packages