Skip to content

ETCD Adapter for Casbin, Casbin is a powerful and efficient open-source access control library.

License

Notifications You must be signed in to change notification settings

php-casbin/etcd-adapter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ETCD adapter for php-casbin

ETCD adapter for PHP-Casbin.

Usage

require_once './vendor/autoload.php';

use Casbin\Enforcer;
use CasbinAdapter\Etcd\Adapter as EtcdAdapter;

$adapter = new EtcdAdapter($server, $version);

$e = new Enforcer('path/to/model.conf', $adapter);

$sub = "alice"; // the user that wants to access a resource.
$obj = "data1"; // the resource that is going to be accessed.
$act = "read"; // the operation that the user performs on the resource.

if ($e->enforce($sub, $obj, $act) === true) {
    // permit alice to read data1
} else {
    // deny the request, show an error
}

Getting Help

License

This project is licensed under the Apache 2.0 license.

About

ETCD Adapter for Casbin, Casbin is a powerful and efficient open-source access control library.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages