realm / realm-object-server

Tracking of issues related to the Realm Object Server and other general issues not related to the specific SDK's
https://realm.io
293 stars 42 forks source link

Feature Request: User Retrieval API for Managing Permissions #378

Open Jyosua opened 6 years ago

Jyosua commented 6 years ago

Goals

If I'm logged into a shared, partially synced realm (such as the default realm) as an admin user, I may want to be able to manage the permissions for another user. This is technically already possible through the current API:

await realm.WriteAsync(tempRealm => {
                var testRole = PermissionRole.Get(tempRealm, "testrole");

                testRole.Users.Add(PermissionUser.Get(tempRealm, "internalUserIdentity"));

                var permission = Permission.Get(testRole, tempRealm);
                permission.CanUpdate = true;
                permission.CanModifySchema = true;
                permission.CanRead = true;
                permission.CanQuery = true;
            });

The problem is that I have no way of programmatically obtaining the user Identity (marked as internalUserIdentity above) without being logged in as that user, so any user management would currently have to be done in Realm Studio and requires some technical knowledge of how Realm works.

Expected Results

I would like to be able to retrieve a list of users for use with the permissions API.