Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Community Member

How to get the type of user role in ISF?

We have functionality to hide all the buttons on Monitor task, which was successfully achieved by javascript. But we need to enable these buttons for only Site Administrators, so that they only can do necessary modifications upon request from end users. Can someone point me to correct direction how to get the user role when a user is not a Site Administrator. Thanks in advance.

Everyone's tags (1)
4 REPLIES
Community Member

How to get the type of user role in ISF?

I see in the active form rules you can set the 'User role' or 'Customer role' as Site Administrator, trying to implement similar feature using javscript.

Community Member

Re: How to get the type of user role in ISF?

Hi Sridhara,

There is not an ISF/JavaScript equivalent for the Active From Rule condition of either User Role or Customer Role. The ISF Global Identifiers which do have conditional rule equivalents are discussed in detail in the ISF Components section of the Active Form Components Guide. You will need your customer credentials to download the guide.

Community Member

How to get the type of user role in ISF?

What about having your custom ISF onload script first run a db query (on older version called a rcFetch) which would evaluate if the person loading form is a member of the site admin ou.

Here's a rough example:

ISF_onLoad()

{

 rcFetch('Q1','Q1PL=' + UserID);

}

This will then run a query to validate if the person is a member of the admin ou.

SELECT * FROM DirOrganizationUnitPeople WHERE PersonID = #P1# AND OrganizationalUnitID = 1 (this should be the id of the site admin ou or the ou which you are referring to as an admin)

then have a call back to determine if any records where return, which indicate the person is a member of the site admin ou.  


function Q81_DataCallback(retArray, queryList)

{

if (retArray['Q8500._COUNT_'] == 1)

 {  *Show the fields*  }

 

}

Hope this helps.

Community Member

How to get the type of user role in ISF?

Thanks Peter and Ed for your suggestions. I have found a much simpler solution of achieving this functionality of user role. We have a function named: isMemberOfRole(roleId) in common.js and global.js file. I have used this function to validate the user (i have hard coded the user role to 40(site admin), which was configured in our env.). In my script i was checking for this value with other task conditions and was able to achieve my desired results. If anyone needs code snippet, please do let me know, I would be able to help.

221
Views
0
Helpful
4
Replies
CreatePlease to create content