Current user reference in template for visibility script

Hello Experts, 

Can anyone tell me if there is a way to reference the current user in a template? I need to add something in the visibility script to be true based on role.

Any help is appreciated. 

Thank you,

Lu 

Parents
  • I would go for the OnLoading-Script of the table where you want to alter the CanSee property for the column.

    In addition, I would check for the existence of a program function (QBMFeature) for the current user. This is way faster than checking a role membership.

    A sample code would look like this

    If Not Session.Principal.Features.IsAllowed("<QBMFeature>") Then
        Entity.Columns("<ColumnName>").CanSee = False
    End If
     

Reply
  • I would go for the OnLoading-Script of the table where you want to alter the CanSee property for the column.

    In addition, I would check for the existence of a program function (QBMFeature) for the current user. This is way faster than checking a role membership.

    A sample code would look like this

    If Not Session.Principal.Features.IsAllowed("<QBMFeature>") Then
        Entity.Columns("<ColumnName>").CanSee = False
    End If
     

Children