Different homepage in service portal based on User Role

sobitha
Kilo Contributor

Can anyone help me how to have different homepages in a single portal based on user roles?

When the user login service portal, based on the user role the homepage should vary.

14 REPLIES 14

Manoj Kumar16
Giga Guru

You can write a before Query Business rule on the table- sp_page with different homepages as Homepage1,Homepage2 etc.



(function executeRule(current, previous /*null when async*/) {


  if (gs.getUser().hasRole('admin')) {


  var qc = current.addQuery('id=Homepage1');


  }


  if (gs.getUser().hasRole('itil')) {


  var qc1 = current.addQuery('id=HomePage2');


  }


  if (gs.getUser().hasRole('cmdb_admin')) {


  var qc2 = current.addQuery('id=Homepage3');


}


  if (gs.getUser().hasRole('asset_admin')) {


  var qc3 = current.addQuery('id=Homepage4');


  }




})(current, previous);


This didn't work Manoj. Do you have some other options?


Adiseshu Borra
Giga Guru

Gurpreet07
Mega Sage

You could create a new page and select that as homepage. In new homepage check for the user roles and redirect accordingly.