label_permission.proto 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. // Copyright 2022 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. package google.apps.drive.labels.v2beta;
  16. import "google/api/resource.proto";
  17. option go_package = "google.golang.org/genproto/googleapis/apps/drive/labels/v2beta;labels";
  18. option java_multiple_files = true;
  19. option java_outer_classname = "LabelPermissionProto";
  20. option java_package = "com.google.apps.drive.labels.v2beta";
  21. option objc_class_prefix = "DLBL";
  22. option (google.api.resource_definition) = {
  23. type: "groups.googleapis.com/Group"
  24. pattern: "groups/{group}"
  25. };
  26. // The permission that applies to a principal (user, group, audience) on a
  27. // label.
  28. message LabelPermission {
  29. option (google.api.resource) = {
  30. type: "drivelabels.googleapis.com/LabelPermission"
  31. pattern: "labels/{label}/permissions/{permission}"
  32. };
  33. // Roles are concentric with subsequent role.
  34. enum LabelRole {
  35. // Unknown role.
  36. LABEL_ROLE_UNSPECIFIED = 0;
  37. // A reader can read the label and associated metadata applied to Drive
  38. // items.
  39. READER = 1;
  40. // An applier can write associated metadata on Drive items in which they
  41. // also have write access to. Implies `READER`.
  42. APPLIER = 2;
  43. // An organizer can pin this label in shared drives they manage
  44. // and add new appliers to the label.
  45. ORGANIZER = 3;
  46. // Editors can make any update including deleting the label which
  47. // also deletes the associated Drive item metadata. Implies `APPLIER`.
  48. EDITOR = 4;
  49. }
  50. // The principal this permission applies to. Must be either an email, user,
  51. // group, or audience.
  52. // Example:
  53. // * people/12345
  54. // * groups/45678
  55. // * audiences/default
  56. oneof principal {
  57. // Person resource name.
  58. string person = 3 [
  59. (google.api.resource_reference) = { type: "people.googleapis.com/Person" }
  60. ];
  61. // Group resource name.
  62. string group = 4 [
  63. (google.api.resource_reference) = { type: "groups.googleapis.com/Group" }
  64. ];
  65. // Audience to grant a role to. The magic value of `audiences/default` may
  66. // be used to apply the role to the default audience in the context of the
  67. // organization that owns the Label.
  68. string audience = 5;
  69. }
  70. // Resource name of this permission.
  71. string name = 1;
  72. // Specifies the email address for a user or group pricinpal. Not populated
  73. // for audience principals. User and Group permissions may only be inserted
  74. // using email address. On update requests, if email address is specified,
  75. // no principal should be specified.
  76. string email = 2;
  77. // The role the principal should have.
  78. LabelRole role = 6;
  79. }