You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

empower-permission

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

empower-permission

Given a permission set and a request return a permission token.

1.0.1
Source
npmnpm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

Build Status Coverage Status

empower-permission

Given a permission set and a request return a permission token.

it will look in the PermissionMap for for a url that matches the given URL. If found, then it will return the BasePermissionToken associated with that URL. Otherwise, it will return the GeneralAccessToken or '*'.

Once it has the base permission token then it will append the interpreted Method (Action) to the token using a : character separator.

PermissionToken

Example Token Strings:

'token:entity:create`
`token:entity:update`
`token:entity:sub-entity:read`

NOTE what precedes the :<action> is entirely up to what you put in the PermissionMap you provide.

PermissionMap

This is a map of URL strings to PermissionTokens

Example Map:

{
  "url/token/entity": "token:entity",
  "url/token/entity/action": "token:entity:action!"
}

Note adding ! to the end of your token marks anything after the last : as an action.

Method

This is either an HTTP Method or a custom action. It will be interpreted into one of the following:

  • READ (GET)
  • WRITE (POST / PUT)
  • CREATE (POST)
  • UPDATE (PUT)
  • DELETE (DELETE)
  • CUSTOM ACTION

Keywords

permission

FAQs

Package last updated on 03 Nov 2015

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