Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@brainhubeu/react-permissible

Package Overview
Dependencies
Maintainers
4
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@brainhubeu/react-permissible - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

LICENSE.md

6

package.json
{
"name": "@brainhubeu/react-permissible",
"version": "1.0.1",
"version": "1.0.2",
"description": "Permission management component for React",

@@ -22,3 +22,4 @@ "engines": {

"dependencies": {
"is-subset": "^0.1.1"
"lodash.difference": "^4.5.0",
"lodash.intersection": "^4.4.0"
},

@@ -65,3 +66,2 @@ "devDependencies": {

"json-loader": "^0.5.4",
"lodash": "^4.17.4",
"mocha": "^3.4.2",

@@ -68,0 +68,0 @@ "node-sass": "^4.5.3",

@@ -228,3 +228,15 @@ # react-permissible

## 🍻
* [@adam-golab](https://github.com/adam-golab) & [@Lukasz-pluszczewski](https://github.com/Lukasz-pluszczewski/) for help
* for help [@adam-golab](https://github.com/adam-golab) & [@Lukasz-pluszczewski](https://github.com/Lukasz-pluszczewski/)
* [Nocny Kochanek](https://nocnykochanek.pl/) band for power
## License
React-permissible is copyright © 2014-2017 [Brainhub](https://brainhub.eu/) It is free software, and may be redistributed under the terms specified in the [license](LICENSE.md).
## About
React-permissible is maintained by [@kkoscielniak](https://github.com/kkoscielniak) & [@adam-golab](https://github.com/adam-golab) & [@Lukasz-pluszczewski](https://github.com/Lukasz-pluszczewski/) and the Brainhub development team. It is funded by Brainhub and the names and logos for Brainhub are trademarks of Brainhub Sp. z o.o.. You can check other open-source projects supported/developed by our teammates here.
[![Brainhub](https://avatars0.githubusercontent.com/u/20307185?s=200&v=4)](https://brainhub.eu/?utm_source=github)
We love open-source JavaScript software! See our other projects or hire us to build your next web, desktop and mobile application with JavaScript.
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import intersection from 'lodash/intersection';
import isSubset from 'is-subset';
import intersection from 'lodash.intersection';
import difference from 'lodash.difference';

@@ -15,3 +15,3 @@ export function Permissible(

? intersection(userPermissions, requiredPermissions).length
: isSubset(userPermissions, requiredPermissions);
: (!requiredPermissions.length || difference(requiredPermissions, userPermissions).length === 0);

@@ -18,0 +18,0 @@ class PermissibleHOC extends Component {

import { Component } from 'react';
import PropTypes from 'prop-types';
import intersection from 'lodash/intersection';
import isSubset from 'is-subset';
import intersection from 'lodash.intersection';
import difference from 'lodash.difference';

@@ -21,3 +21,4 @@ export class PermissibleRender extends Component {

}
return isSubset(userPermissions, requiredPermissions);
return !requiredPermissions.length
|| difference(requiredPermissions, userPermissions).length === 0;
}

@@ -24,0 +25,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc