You need to sign in to do that
Don't have an account?
Apex Managed Sharing Rules restrictions
Hi guys,
I have a code that is creating some Apex Managed Sharing rules, the problem is that this code is executed by the users that don’t have the permission “Modify all data”, and then the sharing rules are not created.
Is there anyway that a User that has a profile without the permission “Modify all data” can create/edit Apex Managed Sharing Rules?
Because this permission is too wide to freely give it to users, so I was wondering if there is any other permission that you can give, a bit more restrictive, but that will allow the users to create sharing rules.
If the previous option is not possible, is there a way to make a piece of code to be executed by another user, like the System.runAs() that you can use in the testmethods?
Thanks a lot!
Hi Pere,
Have you tried using the "without sharing" keyword in your class ?
I looked into the documentation details of your suggestion and as I read I was afraid that it wouldn't solve my problem. But then I found this information hidden in a comment of an example:
This was exactly what I was looking for! I tried it and it seems to be working just fine. :D
Thanks a million!! you really saved my life here!!
The apex article: http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_keywords_sharing.htm