Copybara | 854996b | 2021-09-07 19:36:02 +0000 | [diff] [blame] | 1 | // Copyright 2020 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style |
| 3 | // license that can be found in the LICENSE file. |
| 4 | |
| 5 | syntax = "proto3"; |
| 6 | |
| 7 | package monorail.v3; |
| 8 | |
| 9 | option go_package = "api/v3/api_proto"; |
| 10 | |
| 11 | import "google/api/field_behavior.proto"; |
| 12 | import "api/v3/api_proto/permission_objects.proto"; |
| 13 | |
| 14 | // ***DO NOT CALL rpcs IN THIS SERVICE.*** |
| 15 | // This service is for Monorail's frontend only. |
| 16 | |
| 17 | // Permissions service includes all methods needed for fetching permissions. |
| 18 | service Permissions { |
| 19 | // status: DO NOT USE |
| 20 | // Returns the requester's permissions for the given resource. |
| 21 | // |
| 22 | // Raises: |
| 23 | // PERMISSION_DENIED if the given resource does not exist and/or the |
| 24 | // requester does not have permission to view the resource's name space. |
| 25 | // NOT_FOUND if the given resource does not exist. |
| 26 | rpc GetPermissionSet (GetPermissionSetRequest) returns (PermissionSet) {} |
| 27 | |
| 28 | // status: DO NOT USE |
| 29 | // Returns the requester's permissions for all the given resources. |
| 30 | // |
| 31 | // Raises: |
| 32 | // PERMISSION_DENIED if any of the given resources do not exist and/or the |
| 33 | // requester does not have permission to view one of the resource's |
| 34 | // name space. |
| 35 | // NOT_FOUND if one of the given resources do not exist. |
| 36 | rpc BatchGetPermissionSets (BatchGetPermissionSetsRequest) returns (BatchGetPermissionSetsResponse) {} |
| 37 | } |
| 38 | |
| 39 | |
| 40 | // Request message for the GetPermissionSet emthod. |
| 41 | // Next available tag: 2 |
| 42 | message GetPermissionSetRequest { |
| 43 | // The resource name of the resource permissions to retrieve. |
| 44 | string name = 1 [ (google.api.field_behavior) = REQUIRED ]; |
| 45 | } |
| 46 | |
| 47 | |
| 48 | // Request message for the BatchGetPermissionSets method. |
| 49 | // Next available tag: 2 |
| 50 | message BatchGetPermissionSetsRequest { |
| 51 | // The resource names of the resource permissions to retrieve. |
| 52 | repeated string names = 1 [ (google.api.field_behavior) = REQUIRED ]; |
| 53 | } |
| 54 | |
| 55 | |
| 56 | // Response message for the BatchGetPermissionSets method. |
| 57 | // Next available tag: 2 |
| 58 | message BatchGetPermissionSetsResponse { |
| 59 | // The Permissions, one for each of the given resources. |
| 60 | repeated PermissionSet permission_sets = 1; |
| 61 | } |