Uploaded image for project: 'Realm JavaScript SDK'
  1. Realm JavaScript SDK
  2. RJS-635

applyPermissions gives public access to everyone if userId does not exist

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Do
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None

      Goals

      Giver permission to a user

      Expected Results

      Throw an error if user does not exist

      Actual Results

      The desired folder has public permission applied

      Steps to Reproduce

      1. Create admin user
      2. Create a folder
      3. Try to give access to the folder using a non-existent userId

      Code Sample

        const adminUser = await Realm.Sync.User.login(
          `https://${server_address}`,
          "admin",
          "admin"
        );
      
        const path = `realms://${server_address}/chat`;
      
        adminUser
          .applyPermissions({ userId: "NONEXISTENTUSER" }, "/chat", "read")
          .then((permissionChange) => {
            console.log(permissionChange);
          })
          .catch((error) => {
            console.log(error);
            // ...
          });
      
      

      Results of above code:


      ](url)

      Version of Realm and Tooling

      • Realm JS SDK Version: 6.0.2
      • Node or React Native: Node
      • Client OS & Version: 12.16.1[

            Assignee:
            Unassigned Unassigned
            Reporter:
            unitosyncbot Unito Sync Bot
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: