Are model/row actions done on a "without sharing" basis?

  • 1
  • Question
  • Updated 3 years ago
  • Answered
I want to create my own internal messaging system using a custom object that is designed for my users' specific needs. I want the messaging system to work across all users of the org, but I cannot allow custom sharing of users or making the system default public for users. Without those settings, subordinate users cannot assign records to superiors in role hierarchy or to users of different branches because the superior users and users of other branches are not available as options in the lookup fields. What I am thinking of doing is creating an additional custom object called "directory" and having basic information on each user as records in the directory. I would make this object public. This info would include the User ID. I could then populate the User ID using actions and use it to share the record with the superior, but only if actions run "without sharing", meaning that the sharing rules are suspended and the action executes regardless of sharing entitlements. Anyone know if this is the case with Skuid? I think it is the default for the API and Apex, but it can be forced into "with sharing", so I'm not sure which Skuid uses.
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 17,224 Points 10k badge 2x thumb

Posted 3 years ago

  • 1
Photo of Ben Hubbard

Ben Hubbard, Employee

  • 12,490 Points 10k badge 2x thumb
Skuid models always execute "with sharing".
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 17,224 Points 10k badge 2x thumb
Thanks, any reason that an Apex trigger would be incompatible with a Skuid page? I can accomplish without sharing with Apex, but I'm not sure if that would play well with Skuid.
Photo of Ben Hubbard

Ben Hubbard, Employee

  • 12,490 Points 10k badge 2x thumb
I'm not sure what you mean by a trigger being "incompatible with a Skuid page". You can write your triggers however you want, in whatever sharing context you want.
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 17,224 Points 10k badge 2x thumb
Thanks. I assume Skuid does some Apex. I wasn't sure if my triggers might conflict with whatever Skuid does on model save. Obviously I'm new at Apex. ;)
Thanks