Users and Roles
You also need to create custom roles with the privileges to access your data in MarkLogic Server.
You can set the user credentials in the appropriate gradle*.properties file or you can specify them at the command line when running the Gradle task. To learn how, see Set Security Credentials Using Gradle
General Roles
These roles are used by Data Hub in any platform, whether on-premise or in Data Hub Service (DHS). Compared to legacy roles, general roles allow for more granular privilege management and for easier migration from an on-premise installation to DHS. To use these roles, you need MarkLogic Server 10.0-3 or later.
Role Name | Role Description |
---|---|
data-hub-admin | Permits an assigned user:
|
data-hub-security-admin | Permits an assigned user:
|
data-hub-developer | Permits an assigned user:
|
data-hub-operator | Permits an assigned user:
Important: By default, new documents inherit the permissions of the user account that runs the step. For greater security, this role is configured without default privileges to avoid unintended inheritance. However, MarkLogic Server requires each new document to have at least one
update permission. Therefore, you must explicitly set the step's Target Permissions to specify at least one update permission to assign to new documents created by the step. |
data-hub-monitor | Permits an assigned user:
|
pii-reader | Permits an assigned user to view personally identifiable information (PII). See Managing Personally Identifiable Information. |
Legacy Roles
The following legacy roles are supported for backward compatibility with Data Hub 5.1 or earlier versions.
Role Name | Role Description | Auto-Generated User | When used |
---|---|---|---|
data-hub-admin-role |
Permits an assigned user:
Must be assigned as part of the first deployment (i.e., bootstrapping role). Does not have administrative access to the entire MarkLogic server. Tip: Switch to the data-hub-admin and data-hub-security-admin roles for more granular privileges.
|
data-hub-admin-user |
During setup and maintenance |
flow-developer-role |
Permits an assigned user:
Tip: Switch to the data-hub-developer role for more granular privileges.
(Same role as in Data Hub Service.) |
flow-developer |
During development |
flow-operator-role |
Permits an assigned user:
Tip: Switch to the data-hub-monitor and data-hub-operator roles for more granular privileges.
(Same role as in Data Hub Service.) |
flow-operator |
In a production environment |
Custom Roles and Privileges
In addition to the predefined Data Hub roles, you also need to create and deploy custom roles that give you access to your databases in MarkLogic Server. Custom roles can have predefined MarkLogic privileges or your own custom privileges.
Create Directly in MarkLogic Server
You can create custom privileges directly in MarkLogic Server using the Admin Interface.
You can create custom roles directly in MarkLogic Server:
Create and Deploy Using Gradle
You can manually create your custom roles and privileges in your development environment and later deploy them to your production environment using Gradle.
- (Optional) Create your custom privileges.
The custom privilege definition is a JSON file that contains the privilege name, the kind of privilege (typically
execute
), and the action URI.{ "privilege-name": "my-custom-privilege-name", "kind": "execute", "action": "the-URI-of-the-custom-privilege" }
Note: Store your custom privilege JSON files in the your-project-root/src/main/ml-config/security/privileges directory.Alternatively, you can define your custom privilege within the
privilege
array of your custom role definition. - Create your custom roles with the predefined MarkLogic Server privileges or your custom privileges.
The custom role definition is a JSON file that contains the role name, an optional description, and an array of privileges. See an example.
{ "role-name": "my-role-name", "privilege": [ { "privilege-name": "a-predefined-MarkLogic-privilege-or-a-custom-privilege", "kind": "execute", "action": "the-URI-of-the-privilege" } ] }
For a list of MarkLogic Server privileges, see Appendix B: Pre-defined Execute Privileges of MarkLogic Server Administrator's Guide
Note: Store your custom role JSON files in the your-project-root/src/main/ml-config/security/roles directory. - To deploy the new custom roles and privileges to your production environment (whether on-premise or in DHS), run the Gradle task hubDeployAsSecurityAdmin.
./gradlew hubDeployAsSecurityAdmin -PenvironmentName=dhs -i gradlew.bat hubDeployAsSecurityAdmin -PenvironmentName=dhs -i See an example that shows how to deploy a custom role to DHS.