UserRecordAccess V2 - Calling a web service from a list / in a model?

  • 2
  • Question
  • Updated 4 years ago
I recently posted a question about using the UserRecordAccess object. The solution ended up being a web service. Well, kind of. We can call a web service that uses UserRecordAccess to pass back the user's access to a record, and we can use that to display (or not display) a button on the page. Now we want to use the web service to decide whether or not to display the edit and delete "links" on a list (see attached image). The development team wants the "Edit" and "Delete" access to be columns in a model. I, on the other hand, am new to SKUID and don't care how it works as long as it works :-) . Suggestions on the "best practice" for tackling this would be greatly appreciated.

Photo of Andy Forbes

Andy Forbes

  • 184 Points 100 badge 2x thumb

Posted 4 years ago

  • 2
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
Hi Andy,

I'd create snippet that loops through the records to update a field on each record that would be used to conditionally render those row actions. The one issue with this is this field would be something that should never be saved. It would be best this table only be in read only mode and the model not be used in any component that saves any records. Otherwise, this field will have old data in it. Not too big a concern, but I'd rather not have any temporary data in the object.

You could then set this snippet to run everytime the model is queried.

Also, care to share the solution you put together for the webservice getting the users' access rights.

Pat
(Edited)
Photo of Andy Forbes

Andy Forbes

  • 184 Points 100 badge 2x thumb
Pat - Thanks for the suggestion. The web service was developed for a client so they own the code; I'll ask them if I can post it here.
Photo of Irvin Waldman

Irvin Waldman, Champion

  • 9,006 Points 5k badge 2x thumb
Me thinks that Skuid should handle this.  
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
I as well would like to see it. Otherwise have to go with the same solution Andy's built. One heck of a workaround for something that seems so easy.
Photo of Andy Forbes

Andy Forbes

  • 184 Points 100 badge 2x thumb
I can see both sides of this. Would it be great if Skuid handled this - absolutely! On the other hand, they probably have a two year backlog and this feature may not be something many people have requested.