承接 vespula/user 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

vespula/user

最新稳定版本:2.0.0

Composer 安装命令:

composer require vespula/user

包简介

A simple user class for working with Laminas Permissions ACL. It extends the Laminas\Permissions\Acl\Role\RoleInterface.

README 文档

README

This package is simply a user object which extends the Zend\Permissions\Acl\Role\RoleInterface. This allows you to pass the user object to the isAllowed() method when querying the ACL. You can also populate it miscellaneous data from your Authentication library or from some other source.

See https://docs.zendframework.com/zend-permissions-acl/ for details on using Zend's ACL library.

Example

#!php
<?php
$acl = new Zend\Permissions\Acl\Acl;
$acl->addRole('guest');
$acl->addRole('user', 'guest');
$acl->addRole('admin', 'user');
	
$acl->addResource('posts');
	
$acl->allow('guest', 'posts', 'view');
$acl->allow('user', 'posts', 'add');
$acl->allow('admin');

// User data, such as the role, username, etc. could come from an Auth object or some other object, such as a Config object. That is up to you. 

$user = new \Vespula\User\User('admin');
$user->setUsername('juser');
$user->setFullname('Joe User');

if ($acl->isAllowed($user, 'posts', 'add')) {
    // etc.
}

echo "Hello " . $user->getFullname();

统计信息

  • 总下载量: 375
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 4
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-05-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固