github.com/insionng/yougam@v0.0.0-20170714101924-2bc18d833463/libraries/pingcap/go-hbase/protobuf/AccessControl.proto (about) 1 package proto; 2 /** 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, software 14 * distributed under the License is distributed on an "AS IS" BASIS, 15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 * See the License for the specific language governing permissions and 17 * limitations under the License. 18 */ 19 20 option java_package = "org.apache.hadoop.hbase.protobuf.generated"; 21 option java_outer_classname = "AccessControlProtos"; 22 option java_generic_services = true; 23 option java_generate_equals_and_hash = true; 24 option optimize_for = SPEED; 25 26 import "HBase.proto"; 27 28 message Permission { 29 enum Action { 30 READ = 0; 31 WRITE = 1; 32 EXEC = 2; 33 CREATE = 3; 34 ADMIN = 4; 35 } 36 enum Type { 37 Global = 1; 38 Namespace = 2; 39 Table = 3; 40 } 41 required Type type = 1; 42 optional GlobalPermission global_permission = 2; 43 optional NamespacePermission namespace_permission = 3; 44 optional TablePermission table_permission = 4; 45 } 46 47 message TablePermission { 48 optional TableName table_name = 1; 49 optional bytes family = 2; 50 optional bytes qualifier = 3; 51 repeated Permission.Action action = 4; 52 } 53 54 message NamespacePermission { 55 optional bytes namespace_name = 1; 56 repeated Permission.Action action = 2; 57 } 58 59 message GlobalPermission { 60 repeated Permission.Action action = 1; 61 } 62 63 message UserPermission { 64 required bytes user = 1; 65 required Permission permission = 3; 66 } 67 68 /** 69 * Content of the /hbase/acl/<table or namespace> znode. 70 */ 71 message UsersAndPermissions { 72 message UserPermissions { 73 required bytes user = 1; 74 repeated Permission permissions = 2; 75 } 76 77 repeated UserPermissions user_permissions = 1; 78 } 79 80 message GrantRequest { 81 required UserPermission user_permission = 1; 82 } 83 84 message GrantResponse { 85 } 86 87 message RevokeRequest { 88 required UserPermission user_permission = 1; 89 } 90 91 message RevokeResponse { 92 } 93 94 message GetUserPermissionsRequest { 95 optional Permission.Type type = 1; 96 optional TableName table_name = 2; 97 optional bytes namespace_name = 3; 98 } 99 100 message GetUserPermissionsResponse { 101 repeated UserPermission user_permission = 1; 102 } 103 104 message CheckPermissionsRequest { 105 repeated Permission permission = 1; 106 } 107 108 message CheckPermissionsResponse { 109 } 110 111 service AccessControlService { 112 rpc Grant(GrantRequest) 113 returns (GrantResponse); 114 115 rpc Revoke(RevokeRequest) 116 returns (RevokeResponse); 117 118 rpc GetUserPermissions(GetUserPermissionsRequest) 119 returns (GetUserPermissionsResponse); 120 121 rpc CheckPermissions(CheckPermissionsRequest) 122 returns (CheckPermissionsResponse); 123 }