diff options
-rw-r--r-- | docs/groups.md | 11 | ||||
-rw-r--r-- | docs/users.md | 11 |
2 files changed, 22 insertions, 0 deletions
diff --git a/docs/groups.md b/docs/groups.md index 7aa60cb..dc26d94 100644 --- a/docs/groups.md +++ b/docs/groups.md @@ -11,6 +11,17 @@ Groups are represented as objects in the Gatekeeper system with the following pr Gatekeeper also supports hierarchical groups (see below). +## Getting All Groups + +You can use the `findGroupss` method on the `Gatekeeper` class to get a list (returnes a `GroupCollection`) of the current groups: + +```php +$groups = Gatekeeper::findGroups(); + +// You can then slice it up how you need, like getting the first three +$shortGroupList = $groups->slice(1, 3); +``` + ## Creating a Group Making a new group is as easy as making a new user. One thing to note, the *group name* must be **unique**: diff --git a/docs/users.md b/docs/users.md index 5473910..d20ea24 100644 --- a/docs/users.md +++ b/docs/users.md @@ -28,6 +28,17 @@ echo 'Full name: '.$user->firstName.' '.$user->lastName."\n"; ?> ``` +## Getting All Users + +You can use the `findUsers` method on the `Gatekeeper` class to get a list (returnes a `UserCollection`) of the current users: + +```php +$users = Gatekeeper::findUsers(); + +// You can then slice it up how you need, like getting the first three +$shortUserList = $users->slice(1, 3); +``` + ## Creating Users To create a user, you only need to provide the user details to the `register` method: |