TBD54566975 / dwn-sdk-js

Decentralized Web Node (DWN) Reference implementation
https://identity.foundation/decentralized-web-node/spec/
Apache License 2.0
325 stars 95 forks source link

Change the `can` property type in protocol definition schema to an array #700

Closed thehenrytsai closed 5 months ago

thehenrytsai commented 6 months ago

Currently the can property can only take one action string, changing it to an array will allow the definition to be more concise, and also making more sense when combinations of create, update, and delete are needed.

Case in point:

...
    $actions: [
      {
        who : 'recipient',
        of  : 'foo',
        can : 'create'
      },
      {
        who : 'recipient',
        of  : 'foo',
        can : 'update'
      }
    ],
...

The of value of the update rule is meaningless, because it must be of the same value as create rule counterpart.

thehenrytsai commented 5 months ago

This is now done.