• Pere Martí
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies

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 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!