rayamedia/yima-authorize

There is no license information available for the latest version (dev-master) of this package.

Installs: 20

Dependents: 2

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Type:yima-core-module

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

This package is auto-updated.

Last update: 2024-10-24 04:25:49 UTC


README

[zend framework2, zf2] Authentication

Login User Programaticly

/** @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());