innmind/acl
Composer 安装命令:
composer require innmind/acl
包简介
Reproduce the filesystem ACL mechanism
关键字:
README 文档
README
Small library to reproduce the logic of the unix filesystem access control list.
Installation
composer require innmind/acl
Usage
use Innmind\ACL\{ ACL, User, Group, Mode, }; $acl = ACL::of('r---w---x user:group'); $acl->allows(User::of('foo'), Group::of('bar'), Mode::read); // false $acl->allows(User::of('foo'), Group::of('bar'), Mode::write); // false $acl->allows(User::of('foo'), Group::of('bar'), Mode::execute); // true $acl->allows(User::of('foo'), Group::of('group'), Mode::read); // false $acl->allows(User::of('foo'), Group::of('group'), Mode::write); // true $acl->allows(User::of('foo'), Group::of('group'), Mode::execute); // true $acl->allows(User::of('user'), Group::of('bar'), Mode::read); // true $acl->allows(User::of('user'), Group::of('bar'), Mode::write); // false $acl->allows(User::of('user'), Group::of('bar'), Mode::execute); // true $acl->allows(User::of('user'), Group::of('group'), Mode::read); // true $acl->allows(User::of('user'), Group::of('group'), Mode::write); // true $acl->allows(User::of('user'), Group::of('group'), Mode::execute); // true $acl->toString(); // outputs "r---w---x user:group" $otherAcl = $acl->addUser(Mode::write); $acl->toString(); // outputs "r---w---x user:group" $otherAcl->toString(); // outputs "rw--w---x user:group"
The goal is to reproduce the logic of the filesystem ACL but at the application level so it can be persisted in a user entity and being completely decoupled from the real filesystem.
统计信息
- 总下载量: 9
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-09-14