grantHostAccess method

void grantHostAccess(
  1. String userId,
  2. String hostId
)

userId got the capability terminal on host hostId: the personal access.changed with the host in added (04 8.2).

Implementation

void grantHostAccess(String userId, String hostId) {
  append(
    'access.changed',
    resource: {'kind': 'principal', 'id': userId},
    payload: {
      'permission_version': permissionVersion,
      'added': [
        {
          'kind': 'host',
          'id': hostId,
          'capabilities': ['terminal'],
        },
      ],
      'removed': <Object?>[],
      'changed': <Object?>[],
    },
    audience: userId,
  );
}