updateRole method
Implementation
Future updateRole({
required String id,
required String operator,
String? name,
String? owner,
List<RuleDoc>? rules,
String? contextId,
}) async {
final dynamic builder = DocumentUpdate(Role());
builder.id(Uuid.parse(id));
if (rules != null) {
builder.rules(rules.map((r) => r.asRule()));
}
if (name != null) {
builder.name(name);
}
final request = RoleExt.updateRequest(builder);
final client = getServiceClient(operator);
final envelop = await requestEnvelope(
request: request,
contextId: contextId != null ? hex.decode(contextId) : null,
);
await client.tx.createTransaction(envelop);
return id;
}