0

Member Security - return default if no rows matched

We are looking to apply a security rule to a table using member security. In our security table, there is a default row that should be matched to if the user does not meet the security rules. Is there a way to write the security script so this default row would be returned if the user does not match any other rows?

For example, something like IfNull( *normal security rule below*, *default row with -1 key or value*)

StrToMember([custom_query_sec].[user_name], UserName())

1 reply

null
    • imbarmarinescubar_pyram
    • 1 yr ago
    • Reported - view

    Hi Paul Narup ,

    In the security script you can write any PQL list expression.
    You can use this script to check if an item exists and if not return a different, default item:

    if(
    Count(strToMember([custom_query_sec].[user_name], UserName()))> 0,
    {strToMember([custom_query_sec].[user_name], UserName())},
    {[custom_query_sec].[user_name].[Default User Name]}
    )

Content aside

  • Status Answered
  • 1 yr agoLast active
  • 1Replies
  • 53Views
  • 2 Following