mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-11-23 02:19:07 +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
|
@ -34,6 +34,8 @@
|
||||||
// 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',
|
||||||
'after_create' => 'function3',
|
'after_create' => 'function3',
|
||||||
|
@ -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