1.9.16 • Published 4 years ago

@brainhubeu/react-permissible v1.9.16

Weekly downloads
409
License
MIT
Repository
github
Last release
4 years ago

CircleCI Last commit license PRs Welcome Renovate enabled

Coveralls github Downloads Minified npm Contributors

react-permissible is a React Component allowing to:

  • manage visibility of particular components depending on users permissions
  • replace particular component when the user isn't permitted to see it
  • manage accessability to particular view depending on users permissions
  • fire a callback when the user isn't allowed to go to access the component/route

Why?

Currently there's no permission management in React. The existing components are either over-engineered (full ACL support etc.), or limited to role-based management. react-permissible is simple at its core and solves only one problem. Access the Component if the permissions match, do something otherwise.

Live demo/ docs

You can access live demo/ docs at https://brainhubeu.github.io/react-permissible/.

Installation

npm i @brainhubeu/react-permissible

Usage

import { PermissibleRender } from '@brainhubeu/react-permissible';

...

render() {
  return (
    <PermissibleRender
      userPermissions={permissions}
      requiredPermissions={requiredPermissions}
    >
      <RestrictedComponent/>
    </PermissibleRender>
  );
}

Where:

  • userPermissions is an array of permissions set for current user
  • requiredPermissions is an array of required permissions

More detailed documentation with several use cases covered is available here.

Running tests

npm test

Roadmap

  • Passing a callback function as a prop for PermissibleRender component

License

React-permissible is copyright © 2017-2020 Brainhub It is free software, and may be redistributed under the terms specified in the license.

About

react-permissible is maintained by @kkoscielniak, @adam-golab, @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

We love open-source JavaScript software! See our other projects or hire us to build your next web, desktop and mobile application with JavaScript.

1.9.16

4 years ago

1.9.15

4 years ago

1.9.13

4 years ago

1.9.11

4 years ago

1.9.9

4 years ago

1.9.7

4 years ago

1.9.6

4 years ago

1.9.5

4 years ago

1.9.4

4 years ago

1.9.3

4 years ago

1.9.1

4 years ago

1.9.0

4 years ago

1.8.0

4 years ago

1.7.1

4 years ago

1.6.43

4 years ago

1.6.42

4 years ago

1.6.41

4 years ago

1.6.39

4 years ago

1.6.38

4 years ago

1.6.37

4 years ago

1.6.36

4 years ago

1.6.35

4 years ago

1.6.34

4 years ago

1.6.33

4 years ago

1.6.32

4 years ago

1.6.31

4 years ago

1.6.30

5 years ago

1.6.29

5 years ago

1.6.28

5 years ago

1.6.27

5 years ago

1.6.26

5 years ago

1.6.25

5 years ago

1.6.24

5 years ago

1.6.23

5 years ago

1.6.22

5 years ago

1.6.21

5 years ago

1.6.20

5 years ago

1.6.19

5 years ago

1.6.18

5 years ago

1.6.17

5 years ago

1.6.16

5 years ago

1.6.15

5 years ago

1.6.14

5 years ago

1.6.13

5 years ago

1.6.12

5 years ago

1.6.11

5 years ago

1.6.10

5 years ago

1.6.9

5 years ago

1.6.8

5 years ago

1.6.7

5 years ago

1.6.6

5 years ago

1.7.0

5 years ago

1.6.5

5 years ago

1.6.4

5 years ago

1.6.3

5 years ago

1.6.2

6 years ago

1.6.1

6 years ago

1.6.0

6 years ago

1.5.0

6 years ago

1.4.2

6 years ago

1.4.1

6 years ago

1.4.0

6 years ago

1.3.0

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago