Applying buttons only available in certain environments

0
I'm using two functionalities only for testing purposes and these functions are first removing old data and afterwards they'll add data again. On a production environment this can cause huge problems when used. Is there a way to make sure that these buttons are only available on my local machine and won't be deployed to production?
asked
3 answers
2

Hi Daan,

As I am aware of till now you cannot have visibility of a button based on environments. ATM you can only select visibility based on user role or attribute. It will be nice to have visibility based on constants as well and may be this can be added into idea form.

Another thought in addition to Mike's suggestion could be to add a constant.

The way I do to work around this issue is;

  • Have a constant IsProduction with Boolean true or false
  • Have two different pages one for test and one for production environments, in the test page you can add buttons you want to use for testing purposes but not in the production one.
  • Then in the microflow first check if this constant is true and if yes then take the user to the production page and if it is false then take the user to the test page.

Note: If you don't want to use two pages then you can have one page where users can see the buttons but you can add a check in the microflow of that button to check the value of IsProduction constant and if true display a message saying this functionality is for test purposes only and in test environments you can configure the value for IsProduction to false which will allow you to use the functionality.

There might be a better way of doing this which I am not aware of but as of now i use this approach.

Hope this helps!

answered
2

A couple of thoughts:

These buttons and the associated microflows are permission controlled, I am assuming. If so, you could create a User Role specifically for testing and only assign that user role to users in your development environment (and other environments like test, acceptance, etc.) Then make the buttons and microflows accessible only to users with that role.

Another approach is to use the IsInDevelopment java action from Community Commons at the beginning of your microflow. If the response from that java action is true, then proceed with the microflow activities, otherwise show the user a message box indicating that the microflow can't be run in a production environment.

answered
0

Can't this be solved (assuming you are also the only person that require's these buttons) with simple security?

answered