Hide History from Activity panel
Prerequisite: You must be familiar with the Syntax used in Tutorials and have already created an extension.
This example is a quick solution to hide the history on objects
for Users having Support Agent
Profile
-
It's not fully secured as the hiding is done on client side
-
It can be enhanced by a JS snippet that would remove the information from the DOM completely, but an advanced user could still set a breakpoint in its browser to prevent the JS snippet from being executed and search in the history
-
Allowed profiles could be put in a module parameter, if they need to be changed over time.
- itop_design 3.0
-
<snippets> <snippet id="hide_history_entries" _delta="define"> <placement>core</placement> <rank>0</rank> <content><![CDATA[ class HideHistoryEntries implements iBackofficeStyleExtension { public function GetStyle(): string { // Check if current user has a profile for which we want to hide history entries $aCurrentUserProfiles = \UserRights::ListProfiles(); $aProfilesToHideEntriesFor = ['Support Agent']; foreach ($aCurrentUserProfiles as $sCurrentUserProfile) { if (in_array($sCurrentUserProfile, $aProfilesToHideEntriesFor)) { // Then force edits entries to be hidden return <<<CSS .ibo-activity-entry.ibo-edits-entry { display: none !important; } CSS; } } // Current user doesn't have a restricted profile, leave CSS as-is return ''; } } ]]></content> </snippet> </snippets>
3_1_0/customization/hide-history.txt ยท Last modified:
2023/08/23 16:12 by 127.0.0.1