Contracts written with go-zeknd can use helper functions for setting and checking permissions on arbitrary tokens.
This is somewhat similar to in Solidity the Ownable concept from OpenZeppelin.
Every permission has three attributes:
address
token
role
A token can be any string or byte sequence, which represents an object to be owned. For example, a person's username can be a token that they have ownership over. Other things like tokens could also have ownership.
A permission role is granted to an address on a token. For example, when creating an account, the owner permission can be given to the sender address on the username token.
will grant an owner permission on a userName (token) to the sender address of the transaction. The roles is an array to grant multiple permissions in a single call.
To check for permission for the sender of a transaction,