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

casbin.js

Package Overview
Dependencies
Maintainers
5
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

casbin.js - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

0

.eslintrc.js

@@ -0,0 +0,0 @@ module.exports = {

@@ -0,0 +0,0 @@ {

2

lib/Authorizer.d.ts

@@ -17,3 +17,3 @@ import * as casbin from 'casbin';

* "auto": Specify the casbin server endpoint, and Casbin.js will load permission from it when the identity changes
* "cookies": Casbin.js load the permission data from the cookie "casbin_permission" or the specified cookie key.
* "cookies": Casbin.js load the permission data from the cookie "access_perm" or the specified cookie key.
* "manual": Load the permission mannually with "setPermission"

@@ -20,0 +20,0 @@ * @param args.endpoint Casbin service endpoint, REQUIRED when mode == "auto"

@@ -71,3 +71,3 @@ "use strict";

* "auto": Specify the casbin server endpoint, and Casbin.js will load permission from it when the identity changes
* "cookies": Casbin.js load the permission data from the cookie "casbin_permission" or the specified cookie key.
* "cookies": Casbin.js load the permission data from the cookie "access_perm" or the specified cookie key.
* "manual": Load the permission mannually with "setPermission"

@@ -100,3 +100,3 @@ * @param args.endpoint Casbin service endpoint, REQUIRED when mode == "auto"

this.mode = mode;
const permission = Cookies.get(args.cookieKey ? args.cookieKey : "casbin_perm");
const permission = Cookies.get(args.cookieKey ? args.cookieKey : "access_perm");
if (permission) {

@@ -180,3 +180,3 @@ this.setPermission(permission);

}
return [4 /*yield*/, axios_1.default.get(this.endpoint + "?casbin_subject=" + this.user)];
return [4 /*yield*/, axios_1.default.get(this.endpoint + "?subject=" + this.user)];
case 1:

@@ -183,0 +183,0 @@ resp = _a.sent();

@@ -0,0 +0,0 @@ export declare function saveToLocalStorage(key: string, value: string, expired: number): number;

@@ -5,2 +5,5 @@ "use strict";

var isLocalStorageAvailable = (function () {
if (!window.localStorage) {
return false;
}
try {

@@ -10,3 +13,3 @@ var key = "fUjXn2r59"; // A random key

localStorage.setItem(key, value);
var gotValue = localStorage.getItem(key);
localStorage.getItem(key);
localStorage.removeItem(key);

@@ -13,0 +16,0 @@ return true;

export * from './Authorizer';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import { StringKV } from './types';

@@ -0,0 +0,0 @@ "use strict";

export interface StringKV {
[key: string]: string[];
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
export declare function sleep(ms: number): Promise<unknown>;

@@ -0,0 +0,0 @@ "use strict";

{
"name": "casbin.js",
"version": "0.1.0",
"version": "0.1.1",
"main": "./lib/index.js",

@@ -24,3 +24,2 @@ "types": "./lib/index.d.ts",

"@typescript-eslint/parser": "^3.2.0",
"casbin": "^5.1.2",
"clean-webpack-plugin": "^3.0.0",

@@ -46,6 +45,7 @@ "eslint": "^7.7.0",

"@babel/preset-env": "^7.11.0",
"axios": "^0.19.2",
"axios": "^0.21.1",
"babel-loader": "^8.1.0",
"casbin": "^5.4.2",
"js-cookie": "^2.2.1"
}
}
# Casbin.js
[![NPM version](https://img.shields.io/npm/v/casbin.js)](https://www.npmjs.com/package/casbin.js)
[![Build Status](https://api.travis-ci.com/casbin/casbin.js.svg?branch=master)](https://travis-ci.com/github/casbin/casbin.js)
[![codebeat badge](https://codebeat.co/badges/74b3febb-292f-4633-81df-3a76ea445cd8)](https://codebeat.co/projects/github-com-casbin-casbin-js-master)
![Code size](https://img.shields.io/github/languages/code-size/casbin/casbin.js)
Casbin.js is a frontend port of a backend Casbin service, which facilitates the manipulation, management and storage of the user permission in a frontend application.

@@ -4,0 +9,0 @@

@@ -0,0 +0,0 @@ {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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