Check if a user has a certain Role

From SMTX Wiki
Jump to navigation Jump to search

Via a webservice, you can check if the logged in user has a certain role. You need the webservice called 'Logged in person has role' (DEV: https://dev.ssp7.smt-x.com/Common/Admin/WsCallAddEdit.aspx?genericid=495)

var rolename = g_fieldvalues.filter(function (fld) { return fld.name === "RoleName"; }).map(function (fld) { return fld.value; }).join(""); return StudioInterface.loggedInPersonHasRole(rolename);


You can then use this Webservice in a form, with a hidden field.

In the example below, we check if the user has the role 'EC':

WebserviceLookup('Logged in person has role', , 'RoleName', 'EC')

This will return 'true' or 'false'.