ShiroTrie 1.0.1

Apache Shiro styled permission manager.

There is a newer version of this package available.
See the version list below for details.
Install-Package ShiroTrie -Version 1.0.1
dotnet add package ShiroTrie --version 1.0.1
<PackageReference Include="ShiroTrie" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ShiroTrie --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Introduction

A simple .NET Core library to manage Apache Shiro-styled permissions.

Inspired by the shiro-trie npm package.

Installation

$ dotnet add package ShiroTrie 

Example

var permissions = new[]
{
   "file:read",
   "file:write",
   "directory:delete,create",
   "image:png,jpeg:read,write",
   "audio:mp3,ogg:high,low:sample",
   "user:*",
   "mail",
   "tty"
};

// add permissions to trie
var trie = new PermissionTrie();
trie.Add(scopes);


// test permissions
var checks = new[]
{
   "file:read",
   "file:create",
   "file:update",
   "file:delete",
   "printer",
   "scanner:read",
   "image:png:read",
   "audio:mp3:high:sample",
   "audio:mp3:high:sample:once",
   "user:delete",
   "user:*",
   "user:create",
   "mail",
   "bash-tty",
};

foreach (var check in checks)
{
   Console.WriteLine("{0} = {1}", check, trie.Check(check));
}

Introduction

A simple .NET Core library to manage Apache Shiro-styled permissions.

Inspired by the shiro-trie npm package.

Installation

$ dotnet add package ShiroTrie 

Example

var permissions = new[]
{
   "file:read",
   "file:write",
   "directory:delete,create",
   "image:png,jpeg:read,write",
   "audio:mp3,ogg:high,low:sample",
   "user:*",
   "mail",
   "tty"
};

// add permissions to trie
var trie = new PermissionTrie();
trie.Add(scopes);


// test permissions
var checks = new[]
{
   "file:read",
   "file:create",
   "file:update",
   "file:delete",
   "printer",
   "scanner:read",
   "image:png:read",
   "audio:mp3:high:sample",
   "audio:mp3:high:sample:once",
   "user:delete",
   "user:*",
   "user:create",
   "mail",
   "bash-tty",
};

foreach (var check in checks)
{
   Console.WriteLine("{0} = {1}", check, trie.Check(check));
}

  • .NETCoreApp 2.0

    • No dependencies.

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.5 406 3/27/2019
1.0.4 448 10/18/2018
1.0.3 360 7/4/2018
1.0.2 321 5/8/2018
1.0.1 226 5/7/2018
1.0.0 242 5/4/2018