Permission Levels
There are three types of permissions that can be associated with data items:- VIEW: Allows the grantee to view the data when fetching the item from a storage sylo.
- MODIFY: Allows the grantee to modify the data. This includes the onchain validation record and also the data itself that is held by storage sylos.
- DISTRIBUTE: Allows the grantee to distribute the data.
Record Types
Data permissions are stored as records in the Sylo Data Permissions pallet. There are three differing forms of records to satisfy various use cases:- Data Permission Record: This is the simplest form of record and applies to a single data item.
- Tagged Permission Record: A tagged record will hold a set of data tags. The permission applies to any data items that share at least of the tags in the record. This allows an author to easily grant a permission to a group of related data items.
- Permission Reference Record: This record type indicates that there exists another permission record that is stored offchain on a storage sylo. The offchain permission record itself requires that a on-chain validation record for it exists and stores the actual permissions. This type of record is suitable when an author whishes to grant permissions over many data items that may not share any tags.
Calls
grantDataPermissions
Grants another account access permissions for a set of data items. The caller must be the author or have been granted the DISTRIBUTE permission by the author. Namespaceu32
value will be assigned to each record to
identify it.