一個靈活,基于驅動器PHP 5.4+的Acl包:Lock
一個靈活,基于驅動器PHP 5.4+的Acl包:Lock

Terminology
Caller: An identity object that can have permissions to do somethingDriver: A storage system for permissions which can either be static or persistentPermission: A permission holds an action and an optional (unique) resource. Can be either aRestrictionor aPrivilegeRestriction: A restriction denies you from being able to perform an action (on an optional resource)Privilege: A privilege allows you to perform an action (on an optional resource)Action: An action is something you are either allowed or denied to doResource: A resource can be an object where you can perform one or more actions on. It can either target a certain type of resource or a specific resource by its unique identifier
Features
- Flexible Acl permissions for multiple identities (callers)
- Static or persistent drivers to store permissions
- Action aliases
- Roles
- Conditions (Asserts)
- Easily Implement acl functionality on your caller with a trait
<?php
use BeatSwitch\Lock\Contracts\Caller;
class User implements Caller
{
public function getCallerType()
{
return 'users';
}
public function getCallerId()
{
return $this->id;
}
public function getCallerRoles()
{
return ['editor', 'publisher'];
}
}
本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!