allow method

Job allow(
  1. List<JobPermission> permissions
)

Set the function's required permissions to the batch.

Implementation

Job allow(List<JobPermission> permissions) {
  if (permissions.isEmpty) {
    throw "Must supply at least one permission for job $name";
  }

  unawaited(registerPolicy((permissions)).onError((error, stackTrace) {
    print(error);
  }));

  return Job(name);
}