From e17392e46259e6f2e012017987cf7c31c171488f Mon Sep 17 00:00:00 2001 From: vincent-peugnet Date: Sun, 28 Oct 2018 19:56:27 +0100 Subject: abstract config NWY --- w/class/user.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'w/class/user.php') diff --git a/w/class/user.php b/w/class/user.php index 3ed831d..77d6ba2 100644 --- a/w/class/user.php +++ b/w/class/user.php @@ -30,6 +30,27 @@ class User { return $this->level; } + + public function isvisitor() + { + return $this->level === Modeluser::FREE; + } + + public function canedit() + { + // a modifier en prenant compte du code invitation de l'article + return $this->level >= Modeluser::EDITOR; + } + + public function cancreate() + { + return $this->level >=Modeluser::EDITOR; + } + + public function isadmin() + { + return $this->level === Modeluser::ADMIN; + } } -- cgit v1.2.3