summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Psecio/Gatekeeper/PermissionModel.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/Psecio/Gatekeeper/PermissionModel.php b/src/Psecio/Gatekeeper/PermissionModel.php
index 89f79a8..da9a04f 100644
--- a/src/Psecio/Gatekeeper/PermissionModel.php
+++ b/src/Psecio/Gatekeeper/PermissionModel.php
@@ -49,6 +49,11 @@ class PermissionModel extends \Psecio\Gatekeeper\Model\Mysql
'column' => 'updated',
'type' => 'datetime'
),
+ 'expire' => array(
+ 'description' => 'Expiration Date',
+ 'column' => 'expire',
+ 'type' => 'datetime'
+ ),
'children' => array(
'description' => 'Child Permissions',
'type' => 'relation',
@@ -103,4 +108,14 @@ class PermissionModel extends \Psecio\Gatekeeper\Model\Mysql
);
return $this->getDb()->delete($childPermission);
}
+
+ /**
+ * Test if the permission is expired
+ *
+ * @return boolean Expired/not expired
+ */
+ public function isExpired()
+ {
+ return ($this->expire !== null && $this->expire >= time());
+ }
} \ No newline at end of file