geniv/nette-identity-acl
Composer 安装命令:
composer require geniv/nette-identity-acl
包简介
Identity ACL extension for Nette Framework
README 文档
README
Installation
$ composer require geniv/nette-identity-acl
or
"geniv/nette-identity-acl": "^2.1"
require:
"php": ">=7.0", "nette/application": ">=2.4", "nette/utils": ">=2.4", "geniv/nette-general-form": ">=1.0", "geniv/nette-identity-authorizator": ">=1.0"
Include in application
neon configure:
#identity acl identityAcl: # autowired: true # roleFormContainer: Identity\Acl\RoleFormContainer # resourceFormContainer: Identity\Acl\ResourceFormContainer # privilegeFormContainer: Identity\Acl\PrivilegeFormContainer # aclFormContainer: Identity\Acl\AclFormContainer
if you want to by redefine aclFormContainer then you must use extends, eg.:
class UserAclFormContainer extends AclFormContainer and redefine only method: public function getForm(Form $form).
If you use all content of class AclFormContainer will be not function!
neon configure extension:
extensions: identityAcl: Identity\Acl\Bridges\Nette\Extension
WARNING: rename role, resource and privilege maybe given error in section ACL for NEON driver,
because NEON ID are not linked to self.
DIBI driver with relationships are OK.
presenters:
protected function createComponentRoleForm(RoleForm $roleForm): RoleForm { //$roleForm->setTemplatePath(path); //$roleForm->onSuccess[] = function (Form $form, array $values) { }; //$roleForm->onError[] = function (Form $form) { }; return $roleForm; } protected function createComponentResourceForm(ResourceForm $resourceForm): ResourceForm { //$resourceForm->setTemplatePath(path); //$resourceForm->onSuccess[] = function (Form $form, array $values) { }; //$resourceForm->onError[] = function (Form $form) { }; return $resourceForm; } protected function createComponentPrivilegeForm(PrivilegeForm $privilegeForm): PrivilegeForm { //$privilegeForm->setTemplatePath(path); //$privilegeForm->onSuccess[] = function (Form $form, array $values) { }; //$privilegeForm->onError[] = function (Form $form) { }; return $privilegeForm; } protected function createComponentAclForm(AclForm $aclForm, AclFormContainer $aclFormContainer, IIdentityAuthorizator $identityAuthorizator): AclForm { //$aclFormContainer->onRender = function ($data) { return $data; }; //$aclFormContainer->setMultiSelect(true); // $this['aclForm']['form']->setDefaults($this['aclForm']->getDefaults($id)); // $this['aclForm']['form']->setDefaults($identityAuthorizator->getAclForm($id)); //$aclForm->setTemplatePath(path); //$aclForm->onSuccess[] = function (Form $form, array $values) use ($aclForm) { $aclForm->saveAcl(array $values) }; //$aclForm->onError[] = function (Form $form) { }; return $aclForm; }
usage:
{control roleForm} {control resourceForm} {control privilegeForm} {control aclForm}
geniv/nette-identity-acl 适用场景与选型建议
geniv/nette-identity-acl 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 628 次下载、GitHub Stars 达 0, 最近一次更新时间为 2018 年 03 月 10 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「user」 「nette」 「acl」 「identity」 「geniv」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 geniv/nette-identity-acl 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 geniv/nette-identity-acl 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 geniv/nette-identity-acl 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Laravel Multiauth package
This package provides a flexible way to add Role-based Permissions to Laravel 6.x
Nette Framework adapter for I18n package
Build forms from schema
This package provides a flexible way to add Role-based Permissions to Laravel
Asynchronous MQTT client built on React
统计信息
- 总下载量: 628
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-03-10