zielony/conditionacl
最新稳定版本:v1.1.0
Composer 安装命令:
composer require zielony/conditionacl
包简介
Simple access-control list with conditions
README 文档
README
Conditionacl is an implementation of a simple access-control list (ACL) system that also takes external conditions into account when validating the rules.
Example usage:
$aclFactory = new AclFactory(new YamlFileConfig('...'));
$acl = $aclFactory->fromRole('project-reader');
$user1 = new Domain\User(1, 'user1');
$user2 = new Domain\User(2, 'user2');
$project = new Domain\Project(1, 'first', $user1);
$acl->hasPermissionTo('read', 'project', new Condition\IfUserIsProjectsOwner($user1, $project));
// true
$acl->hasPermissionTo('read', 'project', new Condition\IfUserIsProjectsOwner($user2, $project));
// false
统计信息
- 总下载量: 24
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-only
- 更新时间: 2021-05-31