Skip to main content

Hi,

 

Any ideas on how to do this?

 

I have a SMO (SMartbox) with a column featuring UserIDs

 

On the initialize rule, i want to check if the current user matches any entries in the SMO UserID column.

If so, allow access, otherwise divert to an access denied page.

 

I'm using an expression on a Name Data Label to ensure the current users UserID is in the same format as the UserIDs in the SMO UserID column.

 

I tried using a Get List method on the SMO and passing the UserID of the current into the Filter, but it doesn't work.

Any ideas?

Good day SharpSharp1

 

I would reccomend using the users email address since its a Unique field and its available on system user values.  You can then execute the list method and filter your results using the currently looged in user email. You willl also need to use a count expression to determine if the filter results return 0 which will be no results found (your  divert to access denied page action) and if result equals to 1 it will allow access.  Should you need to know how to implement the count expression, please follow this link: https://community.k2.com/t5/K2-Blackpearl-Forum-Posts/Count-number-of-Rows-in-View/td-p/60939

 

Should this be of help or lead you to a correct direction please mark it as kudo or solutiom

 

Thank you

 

Kind regards

Thabang


Hi  @Sharpharp1;

 

I think the better option would be to use the picker control in your design, in this regard you will configure the control to filter using ID. please see below links:-

https://help.k2.com/onlinehelp/k2smartforms/userguide/current/default.htm#Picker_Control.html

 

we'll support it from here given specifications.

 

Should you find the above information useful kindly mark such as "Kudo and/or Accepted Solution", as this will assist other K2 developers in the near future.

 

Kind regards;

Widson.

 


Reply