Can I run a MarkLogic method which is specific to a role/access?

Viewed 23

I need to run a couple of functions with a specific & custom role that I created which is similar to admin role. Is there any functionality in MarkLogic where I can call a function with a specifc role? Is there any examples for the same?

1 Answers

This feature exists and is called an AMP (temporary amplification of privileges)

  1. Create a role with the extra execute priv, roles etc -but do not assign it to anyone
  2. Create an AMP configuration - mapping a specific function to the new role. When the function is run, it will inherit the extra role.

Please note: For me, I always also make sure the the calling user is meant to have access to that function. This can be achieved with a en execute priv on the calling role and a security assert in the executed function.

Resources:

Related