summaryrefslogtreecommitdiffstats
path: root/docs/users.md
diff options
context:
space:
mode:
authorChris Cornutt <enygma@phpdeveloper.org>2015-07-02 21:47:06 -0500
committerChris Cornutt <enygma@phpdeveloper.org>2015-07-02 21:47:06 -0500
commit6c5330e65e24d50ade2c10b313e2ec9445f90bbe (patch)
tree2ac9ec880054bef56dfbf61421a72bc1288f76a5 /docs/users.md
parente2b0acf8723beba1e677001bd34bd3ba34dbbf62 (diff)
downloadgatekeeper-6c5330e65e24d50ade2c10b313e2ec9445f90bbe.zip
gatekeeper-6c5330e65e24d50ade2c10b313e2ec9445f90bbe.tar.gz
gatekeeper-6c5330e65e24d50ade2c10b313e2ec9445f90bbe.tar.bz2
adding support for the "expires" handling in the user permissions
Diffstat (limited to 'docs/users.md')
-rw-r--r--docs/users.md10
1 files changed, 10 insertions, 0 deletions
diff --git a/docs/users.md b/docs/users.md
index 0ee2e51..347bf6e 100644
--- a/docs/users.md
+++ b/docs/users.md
@@ -225,6 +225,16 @@ if (Gatekeeper::findUserById($userId)->addPermission($permissionId) === true) {
?>
```
+You can also provide an optional second parameter with an expiration time if you only want to allow the user the permission for a limited about of time. This parameter should be in the form of a Unix timestamp:
+
+```php
+<?php
+Gatekeeper::findUserById(1)->addPermission($permissionId, strtotime('+1 day'));
+?>
+```
+
+When fetching a user's permission list (like with `$user->permissions`) it will only return the non-expired or permanent permissions.
+
## Revoking a permission
You can remove a permission from a user by revoking it: