Uploaded image for project: 'Couchbase Gateway'
  1. Couchbase Gateway
  2. CBG-4029

[3.1.9 backport] Users roles are not getting invalidated after a resync

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 3.1.9
    • None
    • SyncGateway
    • Security Level: Public
    • None
    • CBG Sprint 152
    • 1

    Description

      If the sync function is modified to apply roles to a user and then a resync is done, the users roles will remain the same on a GET user call and will be recomputed when the admin roles for that user are changed.

       

      Repro steps:

      1. Create a bucket on server with a document, and a db with that bucket. Bring the db online
      2. Create a user and 2 roles
      3. Change the sync function to assign a role to that user `role("user1", "role1")`
      4. run resync
      5. Check the roles field of the user and see it has not changed
      6. Add the second role to the user and do a GET on the user
      7. See that the first role now appears that was assigned by the sync fn

       

      The theory is that the `invalidateAllPrincipalsCache` that gets ran at the end of resync is not calling `invalUserRoles` when it should be so on the GET user, the roles are not getting recalculated. So essentially, resync is not properly invalidating the dynamically computed roles.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            adamf Adam Fraser
            isaac.lambat Isaac Lambat
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty