Owner Configs

Syntax

Owner configs are stored as a ".owner" property on a path in the database using SET_OWNER operation.

{
  <path>: {  // path cannot include a variable like $key 
    <to>: {
      <target_node>: {
        .owner: {
          inherit: [
            "<ref1>",  // ref1 should be an ancestor node
            "<ref2>"   // ref2 should be an ancestor node
            ...
          ],
          owners: {
            "*": {
              write_owner: true | false,
              write_function: true | false,
              write_rule: true | false,
              branch_owner: true | false,
            },
            "<1st address>": {
              write_owner: true | false,
              write_rule: true | false,
              write_function: true | false,
              branch_owner: true | false,
            },
            "<2nd address>": {
              write_owner: true | false,
              write_rule: true | false,
              write_function: true | false,
              branch_owner: true | false,
            },
            ...
          }
        }
      }
    }
  }
}

Meaning of the syntax keywords can be summarized as follows:

Examples

Owner configs can be set as the following examples:

{
  apps: {
    .owner: {
      owners: {
        "*": {
          write_owner: false,
          write_function: false,
          write_rule: false,
          branch_owner: true
        }
      }
    },
    afan: {
      .owner: {
        owners: {
          "0x12345678901234567890123456789012345678": {
              write_owner: true,
              write_function: true,
              write_rule: true,
              branch_owner: true
          }
        }
      }
    }
  }
}

Application of Owner Configs

Write permission on a rule or owner path is check as follows:

  • When there are no owner configs on the requested path, closest ancestor owner config is applied

  • Owner config always overrides its ancestors' owner configs

Last updated