定制 wnikk/laravel-access-rules 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

wnikk/laravel-access-rules

Composer 安装命令:

composer require wnikk/laravel-access-rules

包简介

Simple system of ACR (access control rules) for Laravel, with roles, groups, unlimited inheritance and possibility of multiplayer use.

README 文档

README

Laravel Access Control Rules

Access Control Rules (Laravel Permissions Package)

License Code Climate PHP Version Require Total Downloads Latest Stable Version Latest Unstable Version

What does Access Control Rules support?

  • Multiple user models.
  • Multiple permissions can be attached to users.
  • Multiple permissions can be attached to groups.
  • Permissions verification.
  • Permissions caching.
  • Events when permissions are attached, detached or synced.
  • Multiple permissions can be attached to user or group.
  • Permissions can be inherited with unlimited investment from users and groups.
  • Laravel gates and policies.

Visual Interface

The visual interface for managing access control rules and permissions can be found at this link. It offers an intuitive and user-friendly environment for administrators to define roles, assign permissions, and configure access rules.

For detailed usage examples and instructions, refer to the example repository.

Documentation, Installation, and Usage Instructions

See the documentation for detailed installation and usage instructions.

Versions & Dependencies

Laravel Access Control Rules PHP Laravel
2.x 7.4 - 8.4 8 - 13
1.x 7.1 - 7.3 5.5 - 8

You can install the package using composer:

composer require wnikk/laravel-access-rules

See the installation page for detailed.

What It Does

This package allows you to manage user permissions and groups (instead roles) in a database.

Once installed you can do stuff like this:

use Wnikk\LaravelAccessRules\AccessRules;

// Add new rule permission
AccessRules::newRule('articles.edit', 'Access to editing articles');
// Adding permissions to a user
$user->addPermission('articles.edit');

Or you can inherit the rights from another user or groups

// According to the existing user from object
$user->inheritPermissionFrom(User::find(1));

// By identifier
$user->inheritPermissionFrom(User::class, 1);

// From the group
$user->inheritPermissionFrom('Group', 1);

Because all permissions will be registered on Laravel's gate, you can check if a user has a permission with Laravel's default can function:

$user->can('articles.edit'); 

Or without model:

$acr = new AccessRules;
$acr->setOwner('AnotherAnySystemUser', 'UserID-From-Any-System-FF01');
$check = $acr->can('articles.edit');
if (!$check) {abort(403);}

Examples of how can be used in more detail described in Basic Usage section.

Opening an Issue

Before opening an issue there are a couple of considerations:

  • You are all awesome!
  • Pull requests are more than welcome.
  • Read the instructions and make sure all steps were followed correctly.
  • Check that the issue is not specific to your development environment setup.
  • Provide duplication steps.
  • Attempt to look into the issue, and if you have a solution, make a pull request.
  • Show that you have made an attempt to look into the issue.
  • Check to see if the issue you are reporting is a duplicate of a previous reported issue.
  • Following these instructions show me that you have tried.
  • Please be considerate that this is an open source project that I provide to the community for FREE when opening an issue.

Alternatives

License

The MIT License (MIT). Please see License File for more information.

wnikk/laravel-access-rules 适用场景与选型建议

wnikk/laravel-access-rules 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3.69k 次下载、GitHub Stars 达 10, 最近一次更新时间为 2023 年 02 月 09 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「security」 「manager」 「rules」 「acl」 「laravel」 「permission」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 wnikk/laravel-access-rules 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 wnikk/laravel-access-rules 我们能提供哪些服务?
定制开发 / 二次开发

基于 wnikk/laravel-access-rules 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 3.69k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 10
  • 点击次数: 29
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 10
  • Watchers: 2
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-02-09