Skip to content

Unable to specify role scope when creating group #80

@ludydoo

Description

@ludydoo

Current behavior
When using cluster.Users().UpsertGroup, I am unable to specify the scope for the group roles. The specified scope is ignored and "*" is
used instead.
The resulting role is data_reader[myBucket:*:*]

Expected behavior
The specified group scope would be stored. The resulting scope should be data_reader[myBucket:myScope:*]

cluster, err: = gocb.Connect("couchbase://localhost", gocb.ClusterOptions {
    Authenticator: gocb.PasswordAuthenticator {
        Username: cbUsername,
        Password: cbPassword,
    },
})
if err != nil {
    return err
}

bucket: = cluster.Bucket("myBucket")
err = bucket.WaitUntilReady(10 * time.Second, nil)
if err != nil {
    return err
}

if err: = bucket.CollectionsV2().CreateScope("myScope", nil);
err != nil {
    return err
}

time.Sleep(5 * time.Second)

err: = cluster.Users().UpsertGroup(gocb.Group{
    Name: "someGroup",
    Roles: [] gocb.Role {
        {
            Name: "data_reader",
            Bucket: "myBucket",
            Scope: "myScope",
        },
    },
}, nil)

The resulting scope is ignored and * is stored.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions