From a9d598d12e682bc81e4c20fbb7fceeaf868c8027 Mon Sep 17 00:00:00 2001 From: Matthew Weier O'Phinney Date: Tue, 20 Mar 2018 11:44:07 -0500 Subject: [PATCH] Minor typographical updates to methods documentation --- doc/book/methods.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/doc/book/methods.md b/doc/book/methods.md index b9c6c2aa..8eb4eb6b 100644 --- a/doc/book/methods.md +++ b/doc/book/methods.md @@ -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 -------------------------------------------------------------------- | ----------- @@ -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()`.