From 56e880eafc0395a89efce7620de2b7080b44fbf9 Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Fri, 11 May 2012 01:38:30 +0200 Subject: [PATCH] Added User::RequireAccessLevel function --- frontend/classes/class.user.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/frontend/classes/class.user.php b/frontend/classes/class.user.php index a8d6a9d..668f2be 100644 --- a/frontend/classes/class.user.php +++ b/frontend/classes/class.user.php @@ -74,4 +74,16 @@ class User extends CPHPDatabaseRecordClass return false; } } + + public function RequireAccessLevel($level) + { + if($this->sAccessLevel < $level) + { + throw new InsufficientAccessLevelException("You do not have the required access level to perform this action."); + } + else + { + return true; + } + } }