Help
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Jim Coyne
Kilo Patron
Part of the Developer Toolbox Series.  Available as a separate Update Set on Share.

 

The "Hide and Protect" Update Set adds functionality to tag certain records in the CI, Group and User tables so they are not accidentally deleted as well as hiding them from non-admin users.  This avoids the issue of technicians selecting "user" accounts that do not belong to a real person.

 

This is useful for tagging records that are very important to certain processes within the platform, such as integrations, Service Catalog items, Workflows, etc...

 

The Update Set will:

  • Add True/False fields called "Do not delete" (u_fpc_do_not_delete) on the cmdb_ci, sys_user_group and sys_user tables
  • Add security rules to only allow admin users to update the fields
  • Add before delete Business Rules on the CI, Group and User tables to cancel the deletion of records that have the field checked
  • Add True/False fields called "Hide record" (u_fpc_hide_record) on the sys_user_group and sys_user tables
  • Add security rules to only allow "admin" users to update the fields
  • Add new before query Business Rules on the Group and User tables to filter out records that have the field checked from non-admin users
  • The "guest" account is allowed to see the records as well in order to allow those users to login

The before delete Business Rules are used to display the warning message.

 

There are a few Modules added to the "Developer Toolbox" Application Menu.

 

find_real_file.png

 

The "Access Controls" Module shows the various Access Control rules which have been added to prevent the changing of the fields.

 

The "Business Rules" Module shows the BRs used on the tables to stop the delete operation and display the message.

 

The "Messages" Module shows a UI Message record that you can modify to fit your needs, or to translate it if required.  The message is shown when someone tries to delete a protected record.

 

The "Tables the Fields Are On" simply shows all the Dictionary Entries for both fields.  Because of the nature of the cmdb_ci table, the "u_fpc_do_not_delete" field is cloned to all tables that are extended from it even though it is only defined on the cmdb_ci table.  That's why there are so many records in that list.

 

NOTE:  Because every client has different form view layouts, and activating Plugins may make changes to those forms as well, this Update Set will NOT add the fields to any form or list view.  You will want to personalize your own list views to include the fields instead.  You can add them to the form view as well if you think they are worth having there.  I try not to make any changes within an Update Set of mine that I share here that may affect upgrades.

 

NOTE: Remember, always a good idea to test it out in your personal development instance first.

 

The Update Set is available here on the Share site.