The db.roles table is added to the schema when having dexie-cloud-addon applied. Roles can be imported using the cli and then consumed using the observable. It is of course also possible to query them using etc.

Roles can be used when sharing data with other users by adding an entry into the members table and set the roles attribute of the member.

Every object in this table is of type Role.

The primary key is a compound key of [realmId+name], meaning that for every realm, there could only be a single role name. Typical apps only add global roles. Global roles have their realmId property set to “rlm-public” and can be referred to from members of any realm. It is also possible to create roles local to a single realm, by setting the realmId to the realm it can be used in.

See Also


Access Control in Dexie Cloud