PHP 클래스 ZfcRbac\Service\AuthorizationService

저자: Michaël Gallego ([email protected])
상속: implements ZfcRbac\Service\AuthorizationServiceInterface
파일 보기 프로젝트 열기: zf-commons/zfc-rbac 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$assertionPluginManager ZfcRbac\Assertion\AssertionPluginManager
$assertions array
$rbac Rbac\Rbac
$roleService RoleService

공개 메소드들

메소드 설명
__construct ( Rbac\Rbac $rbac, RoleService $roleService, AssertionPluginManager $assertionPluginManager ) Constructor
getIdentity ( ) : ZfcRbac\Identity\IdentityInterface | null Get the current identity from the role service
hasAssertion ( string | Rbac\Permission\PermissionInterface $permission ) : boolean Checks if a assertion exists
isGranted ( string | Rbac\Permission\PermissionInterface $permission, mixed $context = null ) : boolean Check if the permission is granted to the current identity
setAssertion ( string | Rbac\Permission\PermissionInterface $permission, string | callable | ZfcRbac\Assertion\AssertionInterface $assertion ) : void Set an assertion
setAssertions ( array $assertions ) : void Set assertions

보호된 메소드들

메소드 설명
assert ( string | callable | ZfcRbac\Assertion\AssertionInterface $assertion, mixed $context = null ) : boolean

메소드 상세

__construct() 공개 메소드

Constructor
public __construct ( Rbac\Rbac $rbac, RoleService $roleService, AssertionPluginManager $assertionPluginManager )
$rbac Rbac\Rbac
$roleService RoleService
$assertionPluginManager ZfcRbac\Assertion\AssertionPluginManager

assert() 보호된 메소드

protected assert ( string | callable | ZfcRbac\Assertion\AssertionInterface $assertion, mixed $context = null ) : boolean
$assertion string | callable | ZfcRbac\Assertion\AssertionInterface
$context mixed
리턴 boolean

getIdentity() 공개 메소드

Get the current identity from the role service
public getIdentity ( ) : ZfcRbac\Identity\IdentityInterface | null
리턴 ZfcRbac\Identity\IdentityInterface | null

hasAssertion() 공개 메소드

Checks if a assertion exists
public hasAssertion ( string | Rbac\Permission\PermissionInterface $permission ) : boolean
$permission string | Rbac\Permission\PermissionInterface
리턴 boolean

isGranted() 공개 메소드

Check if the permission is granted to the current identity
public isGranted ( string | Rbac\Permission\PermissionInterface $permission, mixed $context = null ) : boolean
$permission string | Rbac\Permission\PermissionInterface
$context mixed
리턴 boolean

setAssertion() 공개 메소드

Set an assertion
public setAssertion ( string | Rbac\Permission\PermissionInterface $permission, string | callable | ZfcRbac\Assertion\AssertionInterface $assertion ) : void
$permission string | Rbac\Permission\PermissionInterface
$assertion string | callable | ZfcRbac\Assertion\AssertionInterface
리턴 void

setAssertions() 공개 메소드

Set assertions
public setAssertions ( array $assertions ) : void
$assertions array
리턴 void

프로퍼티 상세

$assertionPluginManager 보호되어 있는 프로퍼티

protected AssertionPluginManager,ZfcRbac\Assertion $assertionPluginManager
리턴 ZfcRbac\Assertion\AssertionPluginManager

$assertions 보호되어 있는 프로퍼티

protected array $assertions
리턴 array

$rbac 보호되어 있는 프로퍼티

protected Rbac,Rbac $rbac
리턴 Rbac\Rbac

$roleService 보호되어 있는 프로퍼티

protected RoleService,ZfcRbac\Service $roleService
리턴 RoleService