Hi Chriss,
If you take a closer look into the Scope.py you can see, that the permissions in this Flatbuffer are not Strings but Vector of Strings. Here is how I got it working.
builder = flatbuffers.Builder(1024)
permissionsRW = builder.CreateString('test-node/**')
Scope.StartPermissionsRwVector(builder, 1)
builder.PrependSOffsetTRelative(permissionsRW)
permissionsRWVector = builder.EndVector()
description = builder.CreateString("Allow to read and write")
name = builder.CreateString("Test-node RW permission")
identifier = builder.CreateString("datalayer.test-node.rw")
Scope.ScopeStart(builder)
Scope.ScopeAddIdentifier(builder, identifier)
Scope.ScopeAddName(builder, name)
Scope.ScopeAddDescription(builder, description)
Scope.ScopeAddPermissionsRw(builder, permissionsRWVector)
scope = Scope.ScopeEnd(builder)
builder.Finish(scope)
variant = Variant()
variant_result = variant.set_flatbuffers(builder.Output())
if variant_result is not Result.OK:
print("ERROR: creating variant flatbuffer: ", variant_result, flush=True)
result, var= datalayer_client.create_sync("datalayer/security/scopes", variant)
if result is not Result.OK:
print("ERROR: create scope failed: ", result, flush=True)
Best regards,
Nick
... View more