Skip to content
This repository was archived by the owner on Nov 8, 2021. It is now read-only.
This repository was archived by the owner on Nov 8, 2021. It is now read-only.

Unclear documentation about permissions handling #421

Description

@apperside

Hi,
I am going through the documentation about how to use query based sync permission (https://docs.realm.io/sync/using-synced-realms/access-control/fine-grained-permissions), and I think there are some unclear points:

this is for example a code snippet in that page

// List all roles
let roles = realm.objects(Realm.Permissions.Role);

// You can query roles in order to find a specific one
let role = realm
  .objects(Realm.Permissions.Role)
  .filtered(`name = 'my-role'`)[0];
  
// Making changes to a Role requires a write transaction
let user = getUser();
realm.write(() => {
  role.members.push(user);
})

// So does creating a new role
realm.write(() => {
  realm.create(Realm.Permissions.Role, { name: "my-new-role" });
});

it assumes that after querying the roles, we have all the data; but since it is a query based sync realm, shoulnd't we get the data by using subscriptions? In that way there is no guarantee that we have all the data.

Goals

Understand how to use permissions on query based sync realms

Actual Results

I do not understand very well how them works.

Metadata

Metadata

Assignees

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions