Get default roles and filters Deprecated

GET /groups/{groupId}/apps/{appId}/services/{serviceId}/default_rule

Get the current default roles and filters.

Path parameters

Responses

  • 200 application/json

    OK

    Hide response attributes Show response attributes object
    • _id string

      The default rule's unique ObjectId identifier.

    • roles array[object]

      An ordered list of default user roles.

      Hide roles attributes Show roles attributes object
      • _id string

        The role's unique ObjectId identifier.

      • document_filters object
        Hide document_filters attributes Show document_filters attributes object
        • read
          One of:

          A rule expression that evaluates to true if the role can read the document.

          A rule expression that evaluates to true if the role can read the document.

        • write
          One of:

          A rule expression that evaluates to true if the role can write to the document.

          A rule expression that evaluates to true if the role can write to the document.

      • name string

        The role's name.

      • apply_when
        One of:

        A rule expression that evaluates to true when this role applies to a user for a specific document.

        A rule expression that evaluates to true when this role applies to a user for a specific document.

      • read
        One of:

        A rule expression that evaluates to true if the role has permission to read all fields in the document. If Device Sync is enabled, use document_filters.read instead.

        A rule expression that evaluates to true if the role has permission to read all fields in the document. If Device Sync is enabled, use document_filters.read instead.

      • write
        One of:

        A rule expression that evaluates to true if the role has permission to add, modify, or remove all fields in the document. If Device Sync is enabled, use document_filters.write instead.

        A rule expression that evaluates to true if the role has permission to add, modify, or remove all fields in the document. If Device Sync is enabled, use document_filters.write instead.

      • insert
        One of:

        A rule expression that evaluates to true if the role has permission to insert a new document into the collection.

        A rule expression that evaluates to true if the role has permission to insert a new document into the collection.

      • delete
        One of:

        A rule expression that evaluates to true if the role has permission to delete a document from the collection.

        A rule expression that evaluates to true if the role has permission to delete a document from the collection.

      • fields object

        Field-level rules for any fields that are not explicitly configured in the role's properties.

      • additional_fields object

        Field-level rules for any fields that are not explicitly configured in the role's properties.

        Hide additional_fields attributes Show additional_fields attributes object
        • read
          One of:

          A rule expression that evaluates to true if the role can read the field's value.

          A rule expression that evaluates to true if the role can read the field's value.

        • write
          One of:

          A rule expression that evaluates to true if the role can write the field's value.

          A rule expression that evaluates to true if the role can write the field's value.

    • filters array[object]

      A list of default query filters.

      Hide filters attributes Show filters attributes object
      • _id string

        The filter's unique ObjectId identifier.

      • name string

        The filter's name.

      • apply_when
        One of:

        A rule expression that evaluates to true if the filter applies to an incoming query.

        A rule expression that evaluates to true if the filter applies to an incoming query.

      • query object

        A MongoDB query object that is merged into an incoming query before the operation runs.

      • projection object

        A MongoDB projection object that is merged into an incoming query before the operation runs.

        Hide projection attribute Show projection attribute object
        • * number Additional properties

          Values are 0 or 1.

  • 404 application/json

    No default rule is defined.

    Hide response attribute Show response attribute object
    • error string

      Value is default rule does not exist on service.

GET /groups/{groupId}/apps/{appId}/services/{serviceId}/default_rule
curl \
 --request GET 'https://services.cloud.mongodb.com/api/admin/v3.0/groups/{groupId}/apps/{appId}/services/{serviceId}/default_rule' \
 --header "Authorization: Bearer $ACCESS_TOKEN"
Response examples (200)
{
  "_id": "string",
  "roles": [
    {
      "_id": "string",
      "document_filters": {},
      "name": "string",
      "fields": {},
      "additional_fields": {}
    }
  ],
  "filters": [
    {
      "_id": "string",
      "name": "string",
      "query": {},
      "projection": {
        "additionalProperty1": 0,
        "additionalProperty2": 0
      }
    }
  ]
}
Response examples (404)
{
  "error": "default rule does not exist on service"
}