From 104dd9869d8d537ae0a5c1886b2e40b8a0818bf2 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 10 Nov 2011 23:05:43 +0800 Subject: [PATCH] Fix: add subelement rights --- htdocs/core/ajax/loadinplace.php | 3 ++- htdocs/core/ajax/saveinplace.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/core/ajax/loadinplace.php b/htdocs/core/ajax/loadinplace.php index 2d688b72425..0b43b1871da 100644 --- a/htdocs/core/ajax/loadinplace.php +++ b/htdocs/core/ajax/loadinplace.php @@ -62,7 +62,8 @@ if((isset($_GET['field']) && ! empty($_GET['field'])) if ($element == 'fichinter') $element = 'ficheinter'; - if ($user->rights->$element->lire || $user->rights->$element->read) + if ($user->rights->$element->lire || $user->rights->$element->read + || $user->rights->$element->$subelement->lire || $user->rights->$element->$subelement->read) { if ($type == 'select') { diff --git a/htdocs/core/ajax/saveinplace.php b/htdocs/core/ajax/saveinplace.php index 428e5ace568..1ac227482a9 100644 --- a/htdocs/core/ajax/saveinplace.php +++ b/htdocs/core/ajax/saveinplace.php @@ -68,7 +68,8 @@ if((isset($_POST['field']) && ! empty($_POST['field'])) if ($element == 'fichinter') $element = 'ficheinter'; - if ($user->rights->$element->creer || $user->rights->$element->write) + if ($user->rights->$element->creer || $user->rights->$element->write + || $user->rights->$element->$subelement->creer || $user->rights->$element->$subelement->write) { // Clean parameters $newvalue = trim($value);