Hot answers tagged

4

This is available now in the Winter '20 release! https://releasenotes.docs.salesforce.com/en-us/winter20/release-notes/rn_files_sharing_set_by_record.htm


3

Your code is overly complicated because you presumed you needed an inner class in your RestResource class. You don't. The main problem is that you've reinvented the wheel with Sharing.Executable. There's already an interface that does what you want: Callable. First, let's rewrite your Sharing class to use Callable: public class Sharing { public ...


1

I think you can do this by adding an Action on the opportunity page layout.. "Subsidy Opportunities". Using LWC in combination with an aura component you can build an Action. This will give you a lot flexibility in terms of visibility and access. If you don't have a Constant class you can create one as a kind of helper utility and add the profiles to that ...


1

inherited sharing behaves identically to not using a sharing mode at all, except when used as a top-level entry point (e.g. a Visualforce or Aura controller, RestResource, etc), in which case the context of the call will be with sharing. If you care about Security Reviews, you should probably use inherited sharing on all classes that do not specify with ...


1

The thing is, sharing mode in Apex only really affects SOQL, DML, and other Apex methods that do query/DB-like work. So perhaps you could centralize these operations in a core class that can be explicitly called in with/out sharing mode. Then all of your dual-mode classes can default to with sharing, but when a sharing-sensitive operation is called you route ...


1

You can't share to a Profile, only a User, Group, or Role (and combinations thereof). You'd have to create some sort of integration to add/remove users to Public Groups based on their profile, then you could share records with that Public Group. If you do this, you won't have to worry about filtering by using the checkboxes, which will eventually have non-...


Only top voted, non community-wiki answers of a minimum length are eligible