Socket
Book a DemoInstallSign in
Socket

react-authority

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-authority

authority component

latest
Source
npmnpm
Version
1.0.4
Version published
Maintainers
1
Created
Source

react-authority

install

$ npm install react-authority --save-dev

usage

import React, { Component } from 'react';
import ReactDom from 'react-dom';
import ReactAuthority from 'react-authority';

ReactDOM.render((
  <ReactAuthority code="create" permission={['create']}>
    <button>创建</button>
  </ReactAuthority>
), document.getElementById('root'));

ReactDOM.render((
  <ReactAuthority code="detail" permission={['create']}>
    <ReactAuthority.Admit>
      <a href="url-to-detail">查看详情</a>
    </ReactAuthority.Admit>
    <ReactAuthority.Deny>
      没有查看权限,没有链接
    </ReactAuthority.Deny>
  </ReactAuthority>
), document.getElementById('root'));

Keywords

authoriry

FAQs

Package last updated on 24 Oct 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts