Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Minor typographical updates to methods documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
weierophinney committed Mar 20, 2018
1 parent e2ce1c2 commit a9d598d
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions doc/book/methods.md
Expand Up @@ -5,21 +5,22 @@
The `Role` provides the base functionality required by the `RoleInterface`.

Method signature | Description
------------------------------------------------| -----------
----------------------------------------------- | -----------
`__construct(string $name) : void` | Create a new instance with the provided name.
`getName() : string` | Retrieve the name assigned to this role.
`addPermission(string $name) : void` | Add a permission for the current role.
`hasPermission(string $name) : bool` | Does the role have the given permission?
`getPermissions(bool $children = true) : array` | Retrieve all the permissions, including children if `$children` is true
`getPermissions(bool $children = true) : array` | Retrieve all permissions, including child permissions if `$children` is true.
`addChild(RoleInterface $child) : Role` | Add a child role to the current instance.
`getChildren() : RoleInterface[]` | Get all the children roles.
`getChildren() : RoleInterface[]` | Get all child roles.
`addParent(RoleInterface $parent) : Role` | Add a parent role to the current instance.
`getParents() : RoleInterface[]` | Get all the parent roles.
`getParents() : RoleInterface[]` | Get all parent roles.

## `Zend\Permissions\Rbac\AssertionInterface`

Custom assertions can be provided to `Rbac::isGranted()` (see below); such
assertions are provided the `Rbac` instance on invocation.
assertions are provided the `Rbac` instance on invocation, along with the role
and permission being tested against.

Method signature | Description
-------------------------------------------------------------------- | -----------
Expand All @@ -34,7 +35,7 @@ Method signature |
----------------------------------------------------------------------------- | -----------
`addRole(string\|RoleInterface $child, array\|RoleInterface $parents = null)` | Add a role to the RBAC. If `$parents` is non-null, the `$child` is also added to any parents provided.
`getRole(string $role) : RoleInterface` | Get the role specified by name, raising an exception if not found.
`getRoles(): RoleInterface[]` | Retrieve all the roles
`getRoles(): RoleInterface[]` | Retrieve all the roles.
`hasRole(string\|RoleInterface $role) : bool` | Recursively queries the RBAC for the given role, returning `true` if found, `false` otherwise.
`getCreateMissingRoles() : bool` | Retrieve the flag that determines whether or not `$parent` roles are added automatically if not present when calling `addRole()`.
`setCreateMissingRoles(bool $flag) : void` | Set the flag that determines whether or not `$parent` roles are added automatically if not present when calling `addRole()`.
Expand Down

0 comments on commit a9d598d

Please sign in to comment.