mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-11-22 18:09:06 +01:00
LSattribute::addToForm(): fix checking user rights before adding/freezing it
This commit is contained in:
parent
a217e42a19
commit
8c317e127c
1 changed files with 7 additions and 1 deletions
|
@ -227,6 +227,12 @@ class LSattribute extends LSlog_staticLoggerClass {
|
||||||
return True;
|
return True;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$myRights = $this -> myRights();
|
||||||
|
if($myRights == 'n') {
|
||||||
|
self :: log_debug("User can't read or write the attribute ".$this -> name.", don't add it to $idForm form.");
|
||||||
|
return True;
|
||||||
|
}
|
||||||
|
|
||||||
$element = $this -> _addToForm($form, $idForm, $obj, $value);
|
$element = $this -> _addToForm($form, $idForm, $obj, $value);
|
||||||
if(!$element)
|
if(!$element)
|
||||||
return false;
|
return false;
|
||||||
|
@ -234,7 +240,7 @@ class LSattribute extends LSlog_staticLoggerClass {
|
||||||
if($this -> getConfig('required', false, 'bool'))
|
if($this -> getConfig('required', false, 'bool'))
|
||||||
$form -> setRequired($this -> name);
|
$form -> setRequired($this -> name);
|
||||||
|
|
||||||
if ( ($form_mode == 0) || ($this -> myRights() == 'r') ) {
|
if ( ($form_mode === false) || ($myRights != 'w') ) {
|
||||||
self :: log_debug("Attribute ".$this -> name." is freeze in form $idForm.");
|
self :: log_debug("Attribute ".$this -> name." is freeze in form $idForm.");
|
||||||
$element -> freeze();
|
$element -> freeze();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue