Skip to main content

Hi,

how to enable/disable row actions edit / delete button based on user access level.

For detail page buttons we have unique id, which helps to refer in the javascripit,

incase of row actions can we able to set unique id which we refer in javascript.

any solutions 


To add some detail to Vijay’s question 🙂 :

We have an SFDC web service wrapped around the userrecordaccess object (since we can’t create a Skuid model for the userrecordaccess object). We can make the Edit and Delete buttons appear or not appear based on what we get back from the webservice, but are struggling to do the same for the buttons on the rows in tables.

This, then, is Vijay’s question: Can we set a unique id on the edit and delete buttons in each row of a table so we can toggle them on and off based on what we get from the call to the web service?



So, No…  Our row actions do not yet have the ability to accept unique ID’s

But another statement you’ve made concerns me.  You can access the objectShare sObject.  Can you not use that object to determine the users record level access? 

If the row actions are on a table where record level security would show or hide individual row’s actions  - this may not be feasible.   But if this is a related list where the record level access is on a singe parent record - you should be able to pull that record’s “share” record and use it for conditional rendering. 

Maybe I’ve rendered a lot of work unnecessary? 


Rob:

Unfortunately - the edit and delete permissions can vary row by row, at least in some of the tables.

Andy


@vijay If we can’t hide the Delete and Edit buttons on rows in a table based on the userrecordaccess values, can we always display the buttons and have them start with javscript that calls the userrecordaccess web service? Basically - when the user clicks the delete button we check to see if they have the needed permission and if they don’t have the needed permission we give them a friendly error message and if they do have the needed permission we do ahead and let them delete the record? And, for that matter, what happens today if we allow a user to try delete a row and they don’t have delete permission? Can we set the error message they get or is it an ugly SFDC error?


Weeee!!! I refer to myself and others when I’m having fun.


Two models is much easier than to conditionally render a row action based on the users access level, but both are possible.



                                                                                                                                           Home {{Model.LabelPlural}}             sumavgsumavg    Company Name      Owner   Opportunity Access <div id="{{OpportunityId}}">{{OpportunityAccessLevel}}</div>          {{{Name}}}  {{Model.Label}}                       Company    Owner       Quantity of Product at Sales Price {{Quantity}} {{PricebookEntry.Product2.Name}} @ {{UnitPrice}}                                                                {{Name}}   {{Model.label}}        opportunities                                                                     Owner: {{{Name}}} {{Id}}                       sumavgsumavg    Company Name      Owner   Opportunity Access <div id="{{OpportunityId}}">{{OpportunityAccessLevel}}</div>

Thanks Pat.  Another innovative way to get things done.