mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-11-22 18:09:06 +01:00
LSobject/LSsession : Added feature to globally disable object creation with configuration parameter
This commit is contained in:
parent
94e5697ab5
commit
d5baeb10e4
2 changed files with 16 additions and 0 deletions
|
@ -33,6 +33,8 @@
|
||||||
// Information des configurations pour la création du conteneur du type d'LSobjet
|
// Information des configurations pour la création du conteneur du type d'LSobjet
|
||||||
// lors de la création nouveau subDn
|
// lors de la création nouveau subDn
|
||||||
),
|
),
|
||||||
|
|
||||||
|
'disable_creation' => [boolean]',
|
||||||
|
|
||||||
'before_modify' => 'function1',
|
'before_modify' => 'function1',
|
||||||
'after_modify' => 'function2',
|
'after_modify' => 'function2',
|
||||||
|
@ -119,6 +121,14 @@
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</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>
|
<varlistentry>
|
||||||
<term>before_modify</term>
|
<term>before_modify</term>
|
||||||
<listitem>
|
<listitem>
|
||||||
|
|
|
@ -1844,6 +1844,12 @@ class LSsession {
|
||||||
* @retval boolean True si l'utilisateur a accès, false sinon
|
* @retval boolean True si l'utilisateur a accès, false sinon
|
||||||
*/
|
*/
|
||||||
public static function canCreate($LSobject) {
|
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');
|
return self :: canAccess($LSobject,NULL,'w','rdn');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue