Filtering HTML Elements

Use HTML filtering if you want to hide a link shown on the screen based on roles assigned to the user. You cannot control access to action links, such as, ‘modify’, ’copy’, and so on that appear against a list entry on a page.

The following example shows how to remove the add new record link from the TaxonomyViewServlet screen for a user with an admin role:

Procedure

  1. Find the HTML name on which the link appears.
  2. Open the HTML file and find the element ID which needs to be controlled. If the element that you want to control does not have an ID, you need to contact TIBCO to assign an ID to it. In this case, it is found to be acreateNP.
  3. If not already present, insert a corresponding new function in the FUNCTION table as follows:
    INSERT INTO FUNCTION ( ID, NAME, DESCRIPTION, FUNCTION ) VALUES ( 66, 'add_new_record', 'Add New Record link', 'add_new_record'); 
  4. If not already present, add a corresponding new element in the HTMLELEMENTID table.
    INSERT INTO HTMLELEMENTID ( ID, NAME, PAGENAME ) VALUES ( 32480, 'acreateNP', 'com.tibco.mdm.ui.repository.taxonomy.TaxonomyView');

    where NAME is the HTML element ID. Contact TIBCO Customer Support to get the PAGENAME.

  5. Add a corresponding record in the FUNC2IDMAP table.
    INSERT INTO FUNC2IDMAP ( ID, FUNCID, NAME, ELEMENTID, ELEMENTTYPE, SECURITY ) VALUES ( 100, 66, 'add_new_record', 32480, 1, 3); 
  6. Identify the ID of the role for which you want hide the HTML element:
    1. Find the enterprise you want to modify and note the enterprise ID. In this example, 1234 is the enterprise ID. Name is case sensitive.
      Select * from enterprise where name = '<<YourEnterpriseName>>'.
    2. Find all of the roles created for the enterprise. A list of roles for the enterprise is displayed. The name is the name of the role that is assigned to a user.
      Select * from role where enterpriseID = ‘<<YourEnterpriseID>>’
    3. Note the role name and the ID of the role you want to modify. This example uses 32870 as the role ID.
  7. Add an entry for this role (identified in step 6), and the function (created in step 3) to the ROLE2FUNCMAP table.
    INSERT INTO ROLE2FUNCMAP (ID, ROLEID, FUNCID, NAME, PRIORITY) VALUES (100, 32870, 'add_new_record', 32480, 1);
  8. Restart the application server.
    Note: If you do not restart the application server, the links are not hidden from the page.