Tracking issued cap grants

Hi all -

I’m building a hApp which is heavily reliant on capabilities. The model is that all entries are private by default, but users can issue a range of different cap grants to other users.

For example:

  • Alice issues a cap grant to 4 other users, permitting them to read entries
  • Carol issues a cap grant to 3 other users, permitting them to create new entries on Carol’s source chain
  • etc etc

At any point in time, Alice or Carol need to revoke specific cap grants for specific users. delete_cap_grant says “The input to [ delete_cap_grant ] is the [ HeaderHash ] of the [ CapGrant ] element to delete”. In tryorama this is easy - I can just store any cap grant HeaderHash in a variable for usage at any point.

But now I’m building out the UI (in Vue) and I’m not sure what is a good pattern to achieve this. Is there a way for a user to simply query their source chain to find out what cap grants they have issued and to who? I started to think that I should build a new set of Cap Grant entries, where I can always have easy access to the relevant HeaderHash - but there must be a better way.

Any advice please?

Thank you - alex

4 Likes