Accès à l'objet externe SystemCache

Bonjour,

nous aimerions donner le droit à un administrateur fonctionnel de vider le cache en lui donnant accès à l’écran suivant :


J’ai créé un groupe SIO_GRP_ADMIN_CLEAR_CACHE
J’ai habilité le raccourci “Cache” avec le groupe créé.
J’ai habilité la fonction “SystemCache” et donc l’objet externe “SystemCache” avec ce même groupe.
J’ai habilité la fonction “Monitoring”
J’ai aussi habilité l’objet “CacheInfo”.
Lorsque je clique sur le raccourci “vider le cache” qui apparaît bien pour l’utilisateur administrateur fonctionnel mais je n’accède toujours pas à l’objet externe “SystemCache”

Que manque t-il pour avoir accès à cet écran ?

Une question préalable : pour quel(s) type(s) d’opération(s) voulez vous donner accès au clear cache global.

Je pose la question car il existe de nombreux clear cache partiels qui en général conviennent pour les opérations de paramétrages à la main des super utilisateurs métier.

Historiquement, il faut être aussi habilité à la fonction de l’action “SYS_CACHE” de l’objet SystemParam, car le clear cache se lançait fut un temps depuis les paramètres systèmes (l’action y est toujours, par compatibilité ascendante, on a du garder ce contrôle).

Attention : vider tous les caches signifie déconnecter tout le monde sans prévenir personne ni aucun save des modification en cours, bref c’est une mise en production. Vous aurez donc des utilisateurs qui vont dire qu’ils se sont faits déconnecter sans sauvegarder leurs données, ou perte de données…

D’où ma question sur les cas d’usage…

C’est pour par exemple modifier les traductions, une déconnexion /reconnexion de l’utilisateur n’est pas suffisante.

Pour les traductions usuelles (objets, attributs, attributs d’objet) le clear cache partiel suffit normalement.
Sur quel(s) type(s) de traductions vous avez des soucis ?

Je l’avais habilité aussi mais toujours pas d’accès à l’écran.
Pour les conséquences, on avait déjà prévenu le client qui ne semble pas dérangé.

C’était sur les traductions d’objet d’attribut mais de manière général un accès à cet écran est demandé depuis un certain temps.

Pour les attributs d’objets ça se fait tout seul via le partial clear cache.

Sinon cf. la réponse de @Francois, mais comme il le dit le clear cache global est une opération lourde de conséquence pour les utilisateurs connectés. Il faut les sensibiliser aux impacts.

Merci pour l’information cependant même avec les recommandations de @Francois j’ai toujours pas l’accès

Il faut les droits à minima en lecture sur l’objet SystemParam + les droits sur l’action SYS_CACHE de cet objet je pense.

Plus les droits sur le raccourci

ça ne semble pas suffisant, voici ce les habilitations réalisées :

<?xml version="1.0" encoding="UTF-8"?>
<simplicite xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.simplicite.fr/base" xsi:schemaLocation="http://www.simplicite.fr/base https://www.simplicite.io/resources/schemas/base.xsd">
<object>
	<name>Group</name>
	<action>upsert</action>
	<data>
		<grp_name>SIO_GRP_ADMIN_CLEAR_CACHE</grp_name>
		<grp_comment><![CDATA[Permet de vider le cache client et serveur de l'application]]></grp_comment>
		<grp_type>G</grp_type>
		<grp_parent_id.grp_name/>
		<grp_home_id.viw_name/>
		<row_module_id.mdl_name>SIOrg</row_module_id.mdl_name>
	</data>
</object>
<object>
	<name>Grant</name>
	<action>upsert</action>
	<data>
		<grt_group_id.grp_name>SIO_GRP_ADMIN_CLEAR_CACHE</grt_group_id.grp_name>
		<grt_function_id.fct_name>AppLog-LC</grt_function_id.fct_name>
		<grt_function_id.fct_object_id.obj_type>O</grt_function_id.fct_object_id.obj_type>
		<grt_function_id.fct_object_id.obj_name>AppLogger</grt_function_id.fct_object_id.obj_name>
		<grt_function_id.fct_action_id.act_name/>
		<grt_function_id.fct_function>C</grt_function_id.fct_function>
		<grt_activ>1</grt_activ>
		<row_module_id.mdl_name>SIOrg</row_module_id.mdl_name>
	</data>
</object>
<object>
	<name>Grant</name>
	<action>upsert</action>
	<data>
		<grt_group_id.grp_name>SIO_GRP_ADMIN_CLEAR_CACHE</grt_group_id.grp_name>
		<grt_function_id.fct_name>AppLoggerMem-ClearCache</grt_function_id.fct_name>
		<grt_function_id.fct_object_id.obj_type>O</grt_function_id.fct_object_id.obj_type>
		<grt_function_id.fct_object_id.obj_name>AppLoggerMemory</grt_function_id.fct_object_id.obj_name>
		<grt_function_id.fct_action_id.act_name>SYS_RESET_CACHE</grt_function_id.fct_action_id.act_name>
		<grt_function_id.fct_function>A</grt_function_id.fct_function>
		<grt_activ>1</grt_activ>
		<row_module_id.mdl_name>SIOrg</row_module_id.mdl_name>
	</data>
</object>
<object>
	<name>Grant</name>
	<action>upsert</action>
	<data>
		<grt_group_id.grp_name>SIO_GRP_ADMIN_CLEAR_CACHE</grt_group_id.grp_name>
		<grt_function_id.fct_name>AppLoggerMemory-R</grt_function_id.fct_name>
		<grt_function_id.fct_object_id.obj_type>O</grt_function_id.fct_object_id.obj_type>
		<grt_function_id.fct_object_id.obj_name>AppLoggerMemory</grt_function_id.fct_object_id.obj_name>
		<grt_function_id.fct_action_id.act_name/>
		<grt_function_id.fct_function>L</grt_function_id.fct_function>
		<grt_activ>1</grt_activ>
		<row_module_id.mdl_name>SIOrg</row_module_id.mdl_name>
	</data>
</object>
<object>
	<name>Grant</name>
	<action>upsert</action>
	<data>
		<grt_group_id.grp_name>SIO_GRP_ADMIN_CLEAR_CACHE</grt_group_id.grp_name>
		<grt_function_id.fct_name>CacheInfo-calculate</grt_function_id.fct_name>
		<grt_function_id.fct_object_id.obj_type>O</grt_function_id.fct_object_id.obj_type>
		<grt_function_id.fct_object_id.obj_name>CacheInfo</grt_function_id.fct_object_id.obj_name>
		<grt_function_id.fct_action_id.act_name>CacheInfo-calculate</grt_function_id.fct_action_id.act_name>
		<grt_function_id.fct_function>A</grt_function_id.fct_function>
		<grt_activ>1</grt_activ>
		<row_module_id.mdl_name>SIOrg</row_module_id.mdl_name>
	</data>
</object>
<object>
	<name>Grant</name>
	<action>upsert</action>
	<data>
		<grt_group_id.grp_name>SIO_GRP_ADMIN_CLEAR_CACHE</grt_group_id.grp_name>
		<grt_function_id.fct_name>CacheInfo-R</grt_function_id.fct_name>
		<grt_function_id.fct_object_id.obj_type>O</grt_function_id.fct_object_id.obj_type>
		<grt_function_id.fct_object_id.obj_name>CacheInfo</grt_function_id.fct_object_id.obj_name>
		<grt_function_id.fct_action_id.act_name/>
		<grt_function_id.fct_function>L</grt_function_id.fct_function>
		<grt_activ>1</grt_activ>
		<row_module_id.mdl_name>SIOrg</row_module_id.mdl_name>
	</data>
</object>
<object>
	<name>Grant</name>
	<action>upsert</action>
	<data>
		<grt_group_id.grp_name>SIO_GRP_ADMIN_CLEAR_CACHE</grt_group_id.grp_name>
		<grt_function_id.fct_name>DispSysParam-CRUD</grt_function_id.fct_name>
		<grt_function_id.fct_object_id.obj_type>O</grt_function_id.fct_object_id.obj_type>
		<grt_function_id.fct_object_id.obj_name>DispSysParam</grt_function_id.fct_object_id.obj_name>
		<grt_function_id.fct_action_id.act_name/>
		<grt_function_id.fct_function>CMS</grt_function_id.fct_function>
		<grt_activ>1</grt_activ>
		<row_module_id.mdl_name>SIOrg</row_module_id.mdl_name>
	</data>
</object>
<object>
	<name>Grant</name>
	<action>upsert</action>
	<data>
		<grt_group_id.grp_name>SIO_GRP_ADMIN_CLEAR_CACHE</grt_group_id.grp_name>
		<grt_function_id.fct_name>Monitoring</grt_function_id.fct_name>
		<grt_function_id.fct_object_id.obj_type>E</grt_function_id.fct_object_id.obj_type>
		<grt_function_id.fct_object_id.obj_name>Monitoring</grt_function_id.fct_object_id.obj_name>
		<grt_function_id.fct_action_id.act_name/>
		<grt_function_id.fct_function>L</grt_function_id.fct_function>
		<grt_activ>1</grt_activ>
		<row_module_id.mdl_name>SIOrg</row_module_id.mdl_name>
	</data>
</object>
<object>
	<name>Grant</name>
	<action>upsert</action>
	<data>
		<grt_group_id.grp_name>SIO_GRP_ADMIN_CLEAR_CACHE</grt_group_id.grp_name>
		<grt_function_id.fct_name>Session-Prune</grt_function_id.fct_name>
		<grt_function_id.fct_object_id.obj_type>O</grt_function_id.fct_object_id.obj_type>
		<grt_function_id.fct_object_id.obj_name>Session</grt_function_id.fct_object_id.obj_name>
		<grt_function_id.fct_action_id.act_name>Session-Prune</grt_function_id.fct_action_id.act_name>
		<grt_function_id.fct_function>A</grt_function_id.fct_function>
		<grt_activ>1</grt_activ>
		<row_module_id.mdl_name>SIOrg</row_module_id.mdl_name>
	</data>
</object>
<object>
	<name>Grant</name>
	<action>upsert</action>
	<data>
		<grt_group_id.grp_name>SIO_GRP_ADMIN_CLEAR_CACHE</grt_group_id.grp_name>
		<grt_function_id.fct_name>Session-RD</grt_function_id.fct_name>
		<grt_function_id.fct_object_id.obj_type>O</grt_function_id.fct_object_id.obj_type>
		<grt_function_id.fct_object_id.obj_name>Session</grt_function_id.fct_object_id.obj_name>
		<grt_function_id.fct_action_id.act_name/>
		<grt_function_id.fct_function>S</grt_function_id.fct_function>
		<grt_activ>1</grt_activ>
		<row_module_id.mdl_name>SIOrg</row_module_id.mdl_name>
	</data>
</object>
<object>
	<name>Grant</name>
	<action>upsert</action>
	<data>
		<grt_group_id.grp_name>SIO_GRP_ADMIN_CLEAR_CACHE</grt_group_id.grp_name>
		<grt_function_id.fct_name>SystemCache</grt_function_id.fct_name>
		<grt_function_id.fct_object_id.obj_type>E</grt_function_id.fct_object_id.obj_type>
		<grt_function_id.fct_object_id.obj_name>SystemCache</grt_function_id.fct_object_id.obj_name>
		<grt_function_id.fct_action_id.act_name/>
		<grt_function_id.fct_function>L</grt_function_id.fct_function>
		<grt_activ>1</grt_activ>
		<row_module_id.mdl_name>SIOrg</row_module_id.mdl_name>
	</data>
</object>
<object>
	<name>Grant</name>
	<action>upsert</action>
	<data>
		<grt_group_id.grp_name>SIO_GRP_ADMIN_CLEAR_CACHE</grt_group_id.grp_name>
		<grt_function_id.fct_name>SystemInfo</grt_function_id.fct_name>
		<grt_function_id.fct_object_id.obj_type>E</grt_function_id.fct_object_id.obj_type>
		<grt_function_id.fct_object_id.obj_name>SystemInfo</grt_function_id.fct_object_id.obj_name>
		<grt_function_id.fct_action_id.act_name/>
		<grt_function_id.fct_function>L</grt_function_id.fct_function>
		<grt_activ>1</grt_activ>
		<row_module_id.mdl_name>SIOrg</row_module_id.mdl_name>
	</data>
</object>
<object>
	<name>Grant</name>
	<action>upsert</action>
	<data>
		<grt_group_id.grp_name>SIO_GRP_ADMIN_CLEAR_CACHE</grt_group_id.grp_name>
		<grt_function_id.fct_name>clearCache-A</grt_function_id.fct_name>
		<grt_function_id.fct_object_id.obj_type>O</grt_function_id.fct_object_id.obj_type>
		<grt_function_id.fct_object_id.obj_name>SystemParam</grt_function_id.fct_object_id.obj_name>
		<grt_function_id.fct_action_id.act_name>clearCache</grt_function_id.fct_action_id.act_name>
		<grt_function_id.fct_function>A</grt_function_id.fct_function>
		<grt_activ>1</grt_activ>
		<row_module_id.mdl_name>SIOrg</row_module_id.mdl_name>
	</data>
</object>
<object>
	<name>Grant</name>
	<action>upsert</action>
	<data>
		<grt_group_id.grp_name>SIO_GRP_ADMIN_CLEAR_CACHE</grt_group_id.grp_name>
		<grt_function_id.fct_name>SYS_CACHE</grt_function_id.fct_name>
		<grt_function_id.fct_object_id.obj_type>O</grt_function_id.fct_object_id.obj_type>
		<grt_function_id.fct_object_id.obj_name>SystemParam</grt_function_id.fct_object_id.obj_name>
		<grt_function_id.fct_action_id.act_name>SYS_CACHE</grt_function_id.fct_action_id.act_name>
		<grt_function_id.fct_function>A</grt_function_id.fct_function>
		<grt_activ>1</grt_activ>
		<row_module_id.mdl_name>SIOrg</row_module_id.mdl_name>
	</data>
</object>
<object>
	<name>Grant</name>
	<action>upsert</action>
	<data>
		<grt_group_id.grp_name>SIO_GRP_ADMIN_CLEAR_CACHE</grt_group_id.grp_name>
		<grt_function_id.fct_name>SYS-CMS</grt_function_id.fct_name>
		<grt_function_id.fct_object_id.obj_type>O</grt_function_id.fct_object_id.obj_type>
		<grt_function_id.fct_object_id.obj_name>SystemParam</grt_function_id.fct_object_id.obj_name>
		<grt_function_id.fct_action_id.act_name/>
		<grt_function_id.fct_function>CMS</grt_function_id.fct_function>
		<grt_activ>1</grt_activ>
		<row_module_id.mdl_name>SIOrg</row_module_id.mdl_name>
	</data>
</object>
<object>
	<name>Grant</name>
	<action>upsert</action>
	<data>
		<grt_group_id.grp_name>SIO_GRP_ADMIN_CLEAR_CACHE</grt_group_id.grp_name>
		<grt_function_id.fct_name>InvalidateSession</grt_function_id.fct_name>
		<grt_function_id.fct_object_id.obj_type>O</grt_function_id.fct_object_id.obj_type>
		<grt_function_id.fct_object_id.obj_name>UserSession</grt_function_id.fct_object_id.obj_name>
		<grt_function_id.fct_action_id.act_name>InvalidateSession</grt_function_id.fct_action_id.act_name>
		<grt_function_id.fct_function>A</grt_function_id.fct_function>
		<grt_activ>1</grt_activ>
		<row_module_id.mdl_name>SIOrg</row_module_id.mdl_name>
	</data>
</object>
<object>
	<name>Grant</name>
	<action>upsert</action>
	<data>
		<grt_group_id.grp_name>SIO_GRP_ADMIN_CLEAR_CACHE</grt_group_id.grp_name>
		<grt_function_id.fct_name>InvalidateSessions</grt_function_id.fct_name>
		<grt_function_id.fct_object_id.obj_type>O</grt_function_id.fct_object_id.obj_type>
		<grt_function_id.fct_object_id.obj_name>UserSession</grt_function_id.fct_object_id.obj_name>
		<grt_function_id.fct_action_id.act_name>InvalidateSessions</grt_function_id.fct_action_id.act_name>
		<grt_function_id.fct_function>A</grt_function_id.fct_function>
		<grt_activ>1</grt_activ>
		<row_module_id.mdl_name>SIOrg</row_module_id.mdl_name>
	</data>
</object>
<object>
	<name>Grant</name>
	<action>upsert</action>
	<data>
		<grt_group_id.grp_name>SIO_GRP_ADMIN_CLEAR_CACHE</grt_group_id.grp_name>
		<grt_function_id.fct_name>UserSession-R</grt_function_id.fct_name>
		<grt_function_id.fct_object_id.obj_type>O</grt_function_id.fct_object_id.obj_type>
		<grt_function_id.fct_object_id.obj_name>UserSession</grt_function_id.fct_object_id.obj_name>
		<grt_function_id.fct_action_id.act_name/>
		<grt_function_id.fct_function>L</grt_function_id.fct_function>
		<grt_activ>1</grt_activ>
		<row_module_id.mdl_name>SIOrg</row_module_id.mdl_name>
	</data>
</object>
<object>
	<name>ShortCutGroup</name>
	<action>upsert</action>
	<data>
		<shg_shortcut_id.shc_name>Cache</shg_shortcut_id.shc_name>
		<shg_group_id.grp_name>SIO_GRP_ADMIN_CLEAR_CACHE</shg_group_id.grp_name>
		<shg_activ>1</shg_activ>
		<row_module_id.mdl_name>SIOrg</row_module_id.mdl_name>
	</data>
</object>
<object>
	<name>Profile</name>
	<action>upsert</action>
	<data>
		<prf_profile_id.grp_name>SIO_PROFIL_RF</prf_profile_id.grp_name>
		<prf_group_id.grp_name>SIO_GRP_ADMIN_CLEAR_CACHE</prf_group_id.grp_name>
		<row_module_id.mdl_name>SIOrg</row_module_id.mdl_name>
	</data>
</object>
</simplicite>

Le raccourci dont on parle ne mene pas à une action de vidage de cache mais à l’objet externe SystemInfo qui affiche

  • des infos plateforme, users connectés…
  • 3 boutons de vidage de cache qui appellent ensuite l’objet externe SystemCache (qui n’est pas un composant graphique mais un web-service de plein d’actions systèmes)

SystemInfo vérifie que l’utilisateur est dans ADMIN ou OPERATOR car zone sensible à du personnel formé un minimum aux effets de ces composants.

Pour vider le cache sans passer par cet écran, il suffit :

  • d’habiliter SystemParam + l’action SYS_CACHE
  • et d’appeler depuis le front $ui.clearCache("dc") depuis ce que vous voulez (clear cache full + logout).

Vous pouvez créer un bouton ou un raccourci qui fait juste cela (avec un confirm préalable) si vous ne voulez pas donner tous les droits de OPERATOR.

Sinon il faudra que nous modifions le comportement de SystemInfo pour laisser passer ceux qui y sont habilités, mais il manquera surement encore des droits en cascade pour afficher les infos systèmes (bref réinventer un clone de OPERATOR). et on ne va pas tout casser si le besoin est juste de vider des libellés. Il y a des verbes pour cela.

Sinon comme le besoin est plus vaste, il est plus simple de donner les droits OPERATOR à un responsable formé à certaines actions (cache, historique des sessions, logs, imports…).