Skip to main content

Administrating MarkLogic Server

Amps

An Amp gives the user additional roles temporarily while the user is performing a certain task (executing a function). While the user is executing the “amp-ed” function, the user receives additional privileges and permissions given by the additional roles. An amp is useful when a user needs additional privileges and permissions only while the user is executing a certain function.

Giving the user additional roles permanently could compromise the security of the system. On the other hand, an amp enables granular security control by limiting the effect of the additional roles (privileges and permissions) to a specific function. For example, a user may need a count of all the documents in the database when the user is creating a report. However, the user does not have read permissions on all the documents in the database, and hence does not know the existence of all the documents in the database. An amp can be created for document-count() to elevate the user to an admin role temporarily while the user is executing the function to count the documents in the system.

An amp is defined by the local name of the function, the namespace and the document URI. The document URI must begin with a forward slash “/” and is treated as being rooted relative to the Modules directory in the installation path. When resolving an amp, MarkLogic Server looks for the file using a path rooted relative to the Modules directory in the installation path. If it finds a function that matches the local name and namespace using the specified path, it applies the amp to the function.

Note

Starting in 9.0-7 for triggers and 10.0-2 for amps, Database names can be used in the trigger and amp creation APIs, thus making it easy to support the same functionality on replica clusters for databases with the same names.

For more details about amps, see Securing MarkLogic Server. For examples of amps, look at one of the amps created during installation. To view an amp, follow the instructions in the section Viewing an Amp.

Use the procedures in this section to create, manage, and maintain amps.