From bd47db68a1d9c1d3a5cb54c8a857221375444655 Mon Sep 17 00:00:00 2001 From: raphael_bertrand Date: Tue, 19 Aug 2008 13:35:16 +0000 Subject: [PATCH] write access restriction update for scripts using the new feature2 param --- htdocs/lib/functions.lib.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/lib/functions.lib.php b/htdocs/lib/functions.lib.php index 292ff4e368c..6e9c0b66906 100644 --- a/htdocs/lib/functions.lib.php +++ b/htdocs/lib/functions.lib.php @@ -1334,7 +1334,6 @@ function restrictedArea($user, $feature='societe', $objectid=0, $dbtablename='', //print "Read access is ok"; // Check write permission from module - // TODO Add after "feature" a param for permission for writing $createok=1; if ($_GET["action"] == 'create' || $_POST["action"] == 'create') { @@ -1362,7 +1361,11 @@ function restrictedArea($user, $feature='societe', $objectid=0, $dbtablename='', { if (! $user->rights->banque->cheque) $createok=0; } - else + else if (! empty($feature2)) // This should be used for future changes + { + if (! $user->rights->$feature->$feature2->write) $readok=0; + } + else if (! empty($feature)) // This is for old permissions { if (! $user->rights->$feature->creer) $createok=0; }