mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-12-18 14:33:49 +01:00
LSaccessRightsMatrixView : show rigths on LSrelations
This commit is contained in:
parent
90399ecdfb
commit
b1252ea0bf
5 changed files with 99 additions and 3 deletions
|
@ -68,6 +68,8 @@ function LSaccessRightsMatrixView() {
|
||||||
foreach (LSsession :: $ldapServer["LSaccess"] as $LSobject) {
|
foreach (LSsession :: $ldapServer["LSaccess"] as $LSobject) {
|
||||||
if (!LSsession :: loadLSobject($LSobject))
|
if (!LSsession :: loadLSobject($LSobject))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
// List attributes and rigths on their
|
||||||
$attrs = array();
|
$attrs = array();
|
||||||
foreach(LSconfig :: get("LSobjects.$LSobject.attrs", array()) as $attr_name => $attr_config) {
|
foreach(LSconfig :: get("LSobjects.$LSobject.attrs", array()) as $attr_name => $attr_config) {
|
||||||
$raw_attr_rights = LSconfig :: get('rights', array(), 'array', $attr_config);
|
$raw_attr_rights = LSconfig :: get('rights', array(), 'array', $attr_config);
|
||||||
|
@ -82,9 +84,27 @@ function LSaccessRightsMatrixView() {
|
||||||
'rights' => $attr_rights,
|
'rights' => $attr_rights,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// List relations and rigths on their
|
||||||
|
$relations = array();
|
||||||
|
foreach(LSconfig :: get("LSobjects.$LSobject.LSrelation", array()) as $relation_name => $relation_config) {
|
||||||
|
$raw_relation_rights = LSconfig :: get('rights', array(), 'array', $relation_config);
|
||||||
|
$relation_rights = array();
|
||||||
|
if ($LSobject == LSsession :: $ldapServer["authObjectType"])
|
||||||
|
$relation_rights['self'] = LSconfig :: get('self', False, null, $raw_relation_rights);
|
||||||
|
foreach(array_keys($LSprofiles) as $LSprofile) {
|
||||||
|
$relation_rights[$LSprofile] = LSconfig :: get($LSprofile, False, null, $raw_relation_rights);
|
||||||
|
}
|
||||||
|
$relations[$relation_name] = array (
|
||||||
|
'label' => __(LSconfig :: get('label', $relation_name, 'string', $relation_config)),
|
||||||
|
'rights' => $relation_rights,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
$LSobjects[$LSobject] = array (
|
$LSobjects[$LSobject] = array (
|
||||||
'label' => __(LSconfig :: get("LSobjects.$LSobject.label", $LSobject, 'string')),
|
'label' => __(LSconfig :: get("LSobjects.$LSobject.label", $LSobject, 'string')),
|
||||||
'attrs' => $attrs,
|
'attrs' => $attrs,
|
||||||
|
'relations' => $relations,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,6 +115,8 @@ function LSaccessRightsMatrixView() {
|
||||||
if ($LSobject == LSsession :: $ldapServer["authObjectType"])
|
if ($LSobject == LSsession :: $ldapServer["authObjectType"])
|
||||||
$LSprofiles = array_merge(array('self' => _('The user him-self')), $LSprofiles);
|
$LSprofiles = array_merge(array('self' => _('The user him-self')), $LSprofiles);
|
||||||
|
|
||||||
|
LSdebug($LSobjects);
|
||||||
|
|
||||||
LStemplate :: assign('pagetitle', _('Access rights matrix'));
|
LStemplate :: assign('pagetitle', _('Access rights matrix'));
|
||||||
LStemplate :: assign('LSprofiles', $LSprofiles);
|
LStemplate :: assign('LSprofiles', $LSprofiles);
|
||||||
LStemplate :: assign('LSobjects', $LSobjects);
|
LStemplate :: assign('LSobjects', $LSobjects);
|
||||||
|
|
Binary file not shown.
|
@ -8,7 +8,7 @@ msgstr ""
|
||||||
"Project-Id-Version: LdapSaisie\n"
|
"Project-Id-Version: LdapSaisie\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: \n"
|
"POT-Creation-Date: \n"
|
||||||
"PO-Revision-Date: 2019-10-10 18:16+0200\n"
|
"PO-Revision-Date: 2019-10-14 12:33+0200\n"
|
||||||
"Last-Translator: Benjamin Renard <brenard@zionetrix.net>\n"
|
"Last-Translator: Benjamin Renard <brenard@zionetrix.net>\n"
|
||||||
"Language-Team: LdapSaisie <ldapsaisie-users@lists.labs.libre-entreprise."
|
"Language-Team: LdapSaisie <ldapsaisie-users@lists.labs.libre-entreprise."
|
||||||
"org>\n"
|
"org>\n"
|
||||||
|
@ -336,10 +336,18 @@ msgstr ""
|
||||||
"défini."
|
"défini."
|
||||||
|
|
||||||
#: /home/brenard/dev/ldapsaisie_clean3/public_html/includes/addons/LSaddons.LSaccessRightsMatrixView.php:52
|
#: /home/brenard/dev/ldapsaisie_clean3/public_html/includes/addons/LSaddons.LSaccessRightsMatrixView.php:52
|
||||||
#: /home/brenard/dev/ldapsaisie_clean3/public_html/includes/addons/LSaddons.LSaccessRightsMatrixView.php:88
|
#: /home/brenard/dev/ldapsaisie_clean3/public_html/includes/addons/LSaddons.LSaccessRightsMatrixView.php:120
|
||||||
msgid "Access rights matrix"
|
msgid "Access rights matrix"
|
||||||
msgstr "Matrice des droits d'accès"
|
msgstr "Matrice des droits d'accès"
|
||||||
|
|
||||||
|
#: /home/brenard/dev/ldapsaisie_clean3/public_html/includes/addons/LSaddons.LSaccessRightsMatrixView.php:62
|
||||||
|
msgid "All connected users"
|
||||||
|
msgstr "Tous les utilisateurs connectés"
|
||||||
|
|
||||||
|
#: /home/brenard/dev/ldapsaisie_clean3/public_html/includes/addons/LSaddons.LSaccessRightsMatrixView.php:116
|
||||||
|
msgid "The user him-self"
|
||||||
|
msgstr "L'utilisateur lui-même"
|
||||||
|
|
||||||
#: /home/brenard/dev/ldapsaisie_clean3/public_html/includes/addons/LSaddons.ftp.php:27
|
#: /home/brenard/dev/ldapsaisie_clean3/public_html/includes/addons/LSaddons.ftp.php:27
|
||||||
msgid "FTP Support : Pear::Net_FTP is missing."
|
msgid "FTP Support : Pear::Net_FTP is missing."
|
||||||
msgstr "Support FTP : Pear::Net_FTP n'est pas installé."
|
msgstr "Support FTP : Pear::Net_FTP n'est pas installé."
|
||||||
|
@ -2102,10 +2110,12 @@ msgid "Only validate data"
|
||||||
msgstr "Validation des données uniquement"
|
msgstr "Validation des données uniquement"
|
||||||
|
|
||||||
#: templates/default/LSaccessRightsMatrixView.tpl:27
|
#: templates/default/LSaccessRightsMatrixView.tpl:27
|
||||||
|
#: templates/default/LSaccessRightsMatrixView.tpl:54
|
||||||
msgid "Readable"
|
msgid "Readable"
|
||||||
msgstr "Lecture"
|
msgstr "Lecture"
|
||||||
|
|
||||||
#: templates/default/LSaccessRightsMatrixView.tpl:29
|
#: templates/default/LSaccessRightsMatrixView.tpl:29
|
||||||
|
#: templates/default/LSaccessRightsMatrixView.tpl:56
|
||||||
msgid "Readable / Writable"
|
msgid "Readable / Writable"
|
||||||
msgstr "Lecture / Écriture"
|
msgstr "Lecture / Écriture"
|
||||||
|
|
||||||
|
@ -2113,10 +2123,22 @@ msgstr "Lecture / Écriture"
|
||||||
msgid "Refresh my access rights"
|
msgid "Refresh my access rights"
|
||||||
msgstr "Rafraîchir mes droits d'accès"
|
msgstr "Rafraîchir mes droits d'accès"
|
||||||
|
|
||||||
|
#: templates/default/LSaccessRightsMatrixView.tpl:42
|
||||||
|
msgid "Relations / Profiles"
|
||||||
|
msgstr "Relations / Profils"
|
||||||
|
|
||||||
#: templates/default/import.tpl:25
|
#: templates/default/import.tpl:25
|
||||||
msgid "Result"
|
msgid "Result"
|
||||||
msgstr "Résultat"
|
msgstr "Résultat"
|
||||||
|
|
||||||
|
#: templates/default/LSaccessRightsMatrixView.tpl:38
|
||||||
|
msgid "Their relations with other objects"
|
||||||
|
msgstr "Leurs relations avec les autres objets"
|
||||||
|
|
||||||
|
#: templates/default/LSaccessRightsMatrixView.tpl:65
|
||||||
|
msgid "This object type has no configured relation."
|
||||||
|
msgstr "Ce type d'objet n'a aucune relation de configurée."
|
||||||
|
|
||||||
#: templates/default/import.tpl:14
|
#: templates/default/import.tpl:14
|
||||||
msgid "Update objects if exists"
|
msgid "Update objects if exists"
|
||||||
msgstr "Mise à jour des objets existants"
|
msgstr "Mise à jour des objets existants"
|
||||||
|
|
|
@ -280,10 +280,18 @@ msgid "Access Right Matrix Support : The global array %{array} is not defined."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: /home/brenard/dev/ldapsaisie_clean3/public_html/includes/addons/LSaddons.LSaccessRightsMatrixView.php:52
|
#: /home/brenard/dev/ldapsaisie_clean3/public_html/includes/addons/LSaddons.LSaccessRightsMatrixView.php:52
|
||||||
#: /home/brenard/dev/ldapsaisie_clean3/public_html/includes/addons/LSaddons.LSaccessRightsMatrixView.php:88
|
#: /home/brenard/dev/ldapsaisie_clean3/public_html/includes/addons/LSaddons.LSaccessRightsMatrixView.php:120
|
||||||
msgid "Access rights matrix"
|
msgid "Access rights matrix"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: /home/brenard/dev/ldapsaisie_clean3/public_html/includes/addons/LSaddons.LSaccessRightsMatrixView.php:62
|
||||||
|
msgid "All connected users"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: /home/brenard/dev/ldapsaisie_clean3/public_html/includes/addons/LSaddons.LSaccessRightsMatrixView.php:116
|
||||||
|
msgid "The user him-self"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: /home/brenard/dev/ldapsaisie_clean3/public_html/includes/addons/LSaddons.ftp.php:27
|
#: /home/brenard/dev/ldapsaisie_clean3/public_html/includes/addons/LSaddons.ftp.php:27
|
||||||
msgid "FTP Support : Pear::Net_FTP is missing."
|
msgid "FTP Support : Pear::Net_FTP is missing."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -1799,10 +1807,12 @@ msgid "Only validate data"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: templates/default/LSaccessRightsMatrixView.tpl:27
|
#: templates/default/LSaccessRightsMatrixView.tpl:27
|
||||||
|
#: templates/default/LSaccessRightsMatrixView.tpl:54
|
||||||
msgid "Readable"
|
msgid "Readable"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: templates/default/LSaccessRightsMatrixView.tpl:29
|
#: templates/default/LSaccessRightsMatrixView.tpl:29
|
||||||
|
#: templates/default/LSaccessRightsMatrixView.tpl:56
|
||||||
msgid "Readable / Writable"
|
msgid "Readable / Writable"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
@ -1810,10 +1820,22 @@ msgstr ""
|
||||||
msgid "Refresh my access rights"
|
msgid "Refresh my access rights"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: templates/default/LSaccessRightsMatrixView.tpl:42
|
||||||
|
msgid "Relations / Profiles"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: templates/default/import.tpl:25
|
#: templates/default/import.tpl:25
|
||||||
msgid "Result"
|
msgid "Result"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: templates/default/LSaccessRightsMatrixView.tpl:38
|
||||||
|
msgid "Their relations with other objects"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: templates/default/LSaccessRightsMatrixView.tpl:65
|
||||||
|
msgid "This object type has no configured relation."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: templates/default/import.tpl:14
|
#: templates/default/import.tpl:14
|
||||||
msgid "Update objects if exists"
|
msgid "Update objects if exists"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
@ -34,6 +34,36 @@
|
||||||
{/foreach}
|
{/foreach}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
<h3>{tr msg="Their relations with other objects"}</h3>
|
||||||
|
{if !empty($LSobjects[$LSobject]['relations'])}
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<th>{tr msg="Relations / Profiles"}</th>
|
||||||
|
{foreach $LSprofiles as $name => $label}
|
||||||
|
<th>{$label} {if $name != $label}<img class='LStips' src="{img name='help'}" alt='?' title='{$name|escape:'htmlall'}'/>{/if}</th>
|
||||||
|
{/foreach}
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{foreach $LSobjects[$LSobject]['relations'] as $name => $conf}
|
||||||
|
<tr>
|
||||||
|
<th>{$conf.label} <img class='LStips' src="{img name='help'}" alt='?' title='{$name|escape:'htmlall'}'/></th>
|
||||||
|
{foreach $LSprofiles as $profil => $profil_conf}
|
||||||
|
<td>
|
||||||
|
{if $conf.rights[$profil] == 'r'}
|
||||||
|
<span class='LSaccessRightsMatrixView_readable'>{tr msg="Readable"}</span>
|
||||||
|
{elseif $conf.rights[$profil] == 'w'}
|
||||||
|
<span class='LSaccessRightsMatrixView_writable'>{tr msg="Readable / Writable"}</span>
|
||||||
|
{/if}
|
||||||
|
</td>
|
||||||
|
{/foreach}
|
||||||
|
</tr>
|
||||||
|
{/foreach}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
{else}
|
||||||
|
<p>{tr msg="This object type has no configured relation."}
|
||||||
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{include file='ls:bottom.tpl'}
|
{include file='ls:bottom.tpl'}
|
||||||
|
|
Loading…
Reference in a new issue