Skip to main content
1-Visitor
May 6, 2020
Solved

Disable button if user can't use it

  • May 6, 2020
  • 2 replies
  • 4080 views

Hello! 
So I have a button that I would like to disable when a specific user doesn't have runtime permission to the service linked to that button. How can I do it? 

Best answer by zyuan1

The Button only receives true and false to enable and disable it's function, so you need to define the logic which user can use them.

 

If you can use Validator language to realize the logic, you can use the validator command, if not, you can create a js service and add it to your data source.

 

It may look like :  return Resources["CurrentSessionInfo"].GetCurrentUser() in ['Abby','Bob','Chandler','Ella'];  and it gives out a true or false result.

2 replies

16-Pearl
May 6, 2020

Buttons have a Visible property which is bindable. 

1-Visitor
May 6, 2020

yes but I would like to have it visible but not clickable, is it not possible?  

16-Pearl
May 6, 2020

There is a Disabled property as well which is bindable. 

Support
June 2, 2020

Hi @JulianaGuerra.

 

If you feel your question has been answered, please mark the appropriate reply as the Accepted Solution, for the benefit of others with the same question.

 

Regards.

 

--Sharon