Class Rbac

Summary

Fully Qualified Name: Zend\Permissions\Rbac\Rbac
Extends: AbstractIterator

Description

Methods

Name Description Defined By
addRole() Add a child. Rbac
current() (PHP 5 >= 5.0.0)
Return the current element
AbstractIterator
getChildren() (PHP 5 >= 5.1.0)
Returns an iterator for the current entry.
AbstractIterator
getCreateMissingRoles() Rbac
getRole() Get a child. Rbac
hasChildren() (PHP 5 >= 5.1.0)
Returns if an iterator can be created fot the current entry.
AbstractIterator
hasRole() Is a child with $name registered? Rbac
isGranted() Determines if access is granted by checking the role and child roles for permission. Rbac
key() (PHP 5 >= 5.0.0)
Return the key of the current element
AbstractIterator
next() (PHP 5 >= 5.0.0)
Move forward to next element
AbstractIterator
rewind() (PHP 5 >= 5.0.0)
Rewind the Iterator to the first element
AbstractIterator
setCreateMissingRoles() Rbac
valid() (PHP 5 >= 5.0.0)
Checks if current position is valid
AbstractIterator

Method Details

addRole()

Add a child.

Parameter Name Type Description
$child string|\RoleInterface
$parents array|\RoleInterface|null

Returns: self

current()

(PHP 5 >= 5.0.0)
Return the current element

Returns: mixed Can return any type.

getChildren()

(PHP 5 >= 5.1.0)
Returns an iterator for the current entry.

Returns: \RecursiveIterator An iterator for the current entry.

getCreateMissingRoles()

Returns: bool

getRole()

Get a child.

Parameter Name Type Description
$objectOrName \Zend\Permissions\Rbac\RoleInterface|string

Returns: \RoleInterface

hasChildren()

(PHP 5 >= 5.1.0)
Returns if an iterator can be created fot the current entry.

Returns: bool true if the current entry can be iterated over, otherwise returns false.

hasRole()

Is a child with $name registered?

Parameter Name Type Description
$objectOrName \Zend\Permissions\Rbac\RoleInterface|string

Returns: bool

isGranted()

Determines if access is granted by checking the role and child roles for permission.

Parameter Name Type Description
$role \RoleInterface|string
$permission string
$assert \AssertionInterface|callable|null

Returns: bool

key()

(PHP 5 >= 5.0.0)
Return the key of the current element

Returns: int|null scalar on success, or null on failure.

next()

(PHP 5 >= 5.0.0)
Move forward to next element

Returns: void Any returned value is ignored.

rewind()

(PHP 5 >= 5.0.0)
Rewind the Iterator to the first element

Returns: void Any returned value is ignored.

setCreateMissingRoles()

Parameter Name Type Description
$createMissingRoles bool

Returns: \Zend\Permissions\Rbac\Rbac

valid()

(PHP 5 >= 5.0.0)
Checks if current position is valid

Returns: bool The return value will be casted to boolean and then evaluated. Returns true on success or false on failure.

Top