Question

show element on page based on role using business rule

Hi community,

 

Anyone know how to get this business rule to work, or if it should work?

goal is to have tab only visible to system administrator role.

The 1st rule when linked to a supervisor user works, but I really need it for the role.

 

Thanks,

Luis

 

 

Like 1

Like

5 comments

It is neccessary to create boolean attribute in the Page code. And then make rules based on that attribute.



We make this based on Operations:

attributes: {
			"UsrCanViewSomeData": {
				"dataValueType": Terrasoft.DataValueType.BOOLEAN,
				"type": Terrasoft.ViewModelColumnType.VIRTUAL_COLUMN
			}
		}
 
 



And add the definition in the method

 

    onEntityInitialized: function() {

                this.callParent(arguments);

                RightUtilities.checkCanExecuteOperation({operation: "UsrCanViewSomeData"}, function(result) {

                    this.set("UsrCanViewSomeData", result);

                }, this);

            }

 

Thanks Vladimir I was looking for the low code approach as it seems to be there, but if this is not a possibilit I'll go for the "code" approach.

Cheers,

Luis

Dear Luis, 



Unfortunately at the moment, business rule filter doesn't work with roles. You can use users instead of roles, but in this case, you will have to create separate business rule for each user.



We have this proposition registered for our R&D team so they will consider the possibility of implementing this functionality in future releases. 



Kind regards,

Roman

 

Hi, please add another vote to address this,  For larger organisations, not having full role-based security, It is not practical to name each User.

Yes please this!!!

Show all comments