allow method

Secret allow(
  1. List<SecretPermission> permissions
)

Set the function's required permissions for the secret.

Implementation

$s.Secret allow(List<SecretPermission> permissions) {
  if (permissions.isEmpty) {
    throw "Must supply at least one permission for secret $name";
  }

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

  return $s.Secret(name);
}