rayamedia/yima-authorize

此包的最新版本(dev-master)没有可用的许可证信息。

安装: 20

依赖: 2

建议者: 0

安全: 0

星星: 0

关注者: 2

分支: 0

开放问题: 0

类型:yima-core-module

dev-master 2015-06-18 11:19 UTC

This package is auto-updated.

Last update: 2024-09-24 04:17:45 UTC


README

[zend framework2, zf2] 身份验证

程序化登录用户

/** @var AuthService $auth */
$auth = $this->authorize('yima_authorize.sample');

$auth->getAuthAdapter()->identity()->setUserIdentity('ehsan');
$auth->getAuthAdapter()->identity()->login();

if (!$auth->isAllowed(null, new PermResource(['route_name' => 'contact'])))
    $auth->riseException();

die($auth->getAuthAdapter()->identity()->hasAuthenticated());