blob: 192684114d76349ce4b7e64b3d8005420ce68ef7 [file] [log] [blame]
// Copyright 2022 The LUCI Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package buildbucket.v2;
option go_package = "go.chromium.org/luci/buildbucket/proto;buildbucketpb";
import "google/protobuf/descriptor.proto";
// Can be used to indicate that a buildbucket.v2.Build field should be visible
// to users with the specified permission. By default, buildbucket.builds.get
// is required to see fields, but this enum allows that access to be expanded.
//
// Note that we assume that users with GET_LIMITED also have LIST, and users
// with GET also have GET_LIMITED and LIST.
//
// IMPORTANT: this enum must be ordered such that permissions that grant more
// access (e.g. BUILDS_GET_PERMISSION) must always have lower enum numbers than
// permissions that grant less access (e.g. BUILDS_LIST_PERMISSION).
enum BuildFieldVisibility {
// No visibility specified. In this case the visibility defaults to
// requiring the buildbucket.builds.get permission.
FIELD_VISIBILITY_UNSPECIFIED = 0;
// Indicates the field will only be visible to users with the
// buildbucket.builds.get permission.
BUILDS_GET_PERMISSION = 1;
// Indicates the field will be visible to users with either the
// buildbucket.builds.getLimited or buildbucket.builds.get permission.
BUILDS_GET_LIMITED_PERMISSION = 2;
// Indicates the field will be visible to users with either the
// buildbucket.builds.list, buildbucket.builds.getLimited or
// buildbucket.builds.get permission.
BUILDS_LIST_PERMISSION = 3;
}
extend google.protobuf.FieldOptions {
// Can be used to indicate that a buildbucket.v2.Build field should be visible
// to users with the specified permission. By default, buildbucket.builds.get
// is required to see fields, but this annotation allows that access to be
// expanded.
//
// Note that we assume that users with GET_LIMITED also have LIST, and users
// with GET also have GET_LIMITED and LIST.
BuildFieldVisibility visible_with = 910567;
}