grantRoles method

  1. @override
Future<List<String>?> grantRoles(
  1. String? correlationId,
  2. String userId,
  3. List<String> roles
)
override

Grants a roles.

  • correlation_id (optional) transaction id to trace execution through call chain.
  • userId an user id.
  • roles a roles to be granted. Return (optional) Future that receives granted roles or error.

Implementation

@override
Future<List<String>?> grantRoles(
    String? correlationId, String userId, List<String> roles) async {
  var result = await callCommand(
      'grant_roles', correlationId, {'user_id': userId, 'roles': roles});
  if (result == null) return null;
  var res_roles = List<String>.from(json.decode(result));
  return res_roles;
}