Is User Member Of Role SmartObject Error

  • 30 April 2019
  • 1 reply
  • 10 views

Badge +3

Good afternoon,

 

I have a SmartForm rule that checks to see if the current user is a member of the K2 Role created for the solution. When the end users attempt to use the solution, they receive a message stating they do not have administrator permissions. I am trying to use the User Role SmartObject (User Role -> IsUserMemberOfRole). You can access this SmartObject from the SmartObject Explorer by expanding the following items System->Management->Users->SmartObjects->User Role->Methods->IsUserMemberOfRole. From what I understand, this SmartObject uses the K2 Service Account to execute. How is it possible the user requires administrator permissions (set at the Server Rights) if the SmartObject is using the Service Account?

 

I cannot use this SmartObject in my solution if the user requires administrator permissions. Are there any alternatives?

 

This is for K2 4.7.

 

Thanks,

Justin


1 reply

Userlevel 5
Badge +16

Hi JS2,


 


As far as I know this is expected behaviour when you execute system smartobjects.


The service auth type is impersonation but there is another smartobject you can use to achieve the same results.


 


Make a use of the URM User SmartObject, you can call Get Role Users method and filter the results on the logged in user FQN. 



 


Return the results to a data label then you can validate if the data label does not contain a value then the current user is not a member of the role.


 


HTH


 

Reply