LSobject/LSsession : Added feature to globally disable object creation with configuration parameter

This commit is contained in:
Benjamin Renard 2010-08-02 14:39:50 +02:00
parent 94e5697ab5
commit d5baeb10e4
2 changed files with 16 additions and 0 deletions

View file

@ -33,6 +33,8 @@
// Information des configurations pour la création du conteneur du type d'LSobjet
// lors de la création nouveau subDn
),
'disable_creation' => [boolean]',
'before_modify' => 'function1',
'after_modify' => 'function2',
@ -119,6 +121,14 @@
</listitem>
</varlistentry>
<varlistentry>
<term>disable_creation</term>
<listitem>
<simpara>Booléen permetant de desactiver la creation de ce type d'objet de
manière globale.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>before_modify</term>
<listitem>

View file

@ -1844,6 +1844,12 @@ class LSsession {
* @retval boolean True si l'utilisateur a accès, false sinon
*/
public static function canCreate($LSobject) {
if (!self :: loadLSobject($LSobject)) {
return;
}
if (LSconfig :: get("LSobjects.$LSobject.disable_creation")) {
return;
}
return self :: canAccess($LSobject,NULL,'w','rdn');
}