feat: correct create projectgrant usergrant (#389)

* feat: correct create projectgrant usergrant

* fix: remove orgid in frontend
This commit is contained in:
Fabi 2020-07-08 11:24:34 +02:00 committed by GitHub
parent c621fdee41
commit 5e42ff2bb8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 14034 additions and 13441 deletions

View File

@ -259,7 +259,6 @@ export class MgmtUserService {
roleNamesList: string[],
): Promise<UserGrant> {
const req = new ProjectGrantUserGrantCreate();
req.setOrgId(orgId);
req.setProjectId(projectId);
req.setProjectGrantId(grantId);
req.setUserId(userId);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -3570,7 +3570,7 @@
"200": {
"description": "A successful response.",
"schema": {
"type": "object"
"$ref": "#/definitions/protobufStruct"
}
}
},
@ -3581,6 +3581,19 @@
}
},
"definitions": {
"protobufListValue": {
"type": "object",
"properties": {
"values": {
"type": "array",
"items": {
"$ref": "#/definitions/protobufValue"
},
"description": "Repeated field of dynamically typed values."
}
},
"description": "`ListValue` is a wrapper around a repeated field of values.\n\nThe JSON representation for `ListValue` is JSON array."
},
"protobufNullValue": {
"type": "string",
"enum": [
@ -3589,6 +3602,51 @@
"default": "NULL_VALUE",
"description": "`NullValue` is a singleton enumeration to represent the null value for the\n`Value` type union.\n\n The JSON representation for `NullValue` is JSON `null`.\n\n - NULL_VALUE: Null value."
},
"protobufStruct": {
"type": "object",
"properties": {
"fields": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/protobufValue"
},
"description": "Unordered map of dynamically typed values."
}
},
"description": "`Struct` represents a structured data value, consisting of fields\nwhich map to dynamically typed values. In some languages, `Struct`\nmight be supported by a native representation. For example, in\nscripting languages like JS a struct is represented as an\nobject. The details of that representation are described together\nwith the proto support for the language.\n\nThe JSON representation for `Struct` is JSON object."
},
"protobufValue": {
"type": "object",
"properties": {
"null_value": {
"$ref": "#/definitions/protobufNullValue",
"description": "Represents a null value."
},
"number_value": {
"type": "number",
"format": "double",
"description": "Represents a double value."
},
"string_value": {
"type": "string",
"description": "Represents a string value."
},
"bool_value": {
"type": "boolean",
"format": "boolean",
"description": "Represents a boolean value."
},
"struct_value": {
"$ref": "#/definitions/protobufStruct",
"description": "Represents a structured value."
},
"list_value": {
"$ref": "#/definitions/protobufListValue",
"description": "Represents a repeated `Value`."
}
},
"description": "`Value` represents a dynamically typed value which can be either\nnull, a number, a string, a boolean, a recursive struct value, or a\nlist of values. A producer of value is expected to set one of that\nvariants, absence of any variant indicates an error.\n\nThe JSON representation for `Value` is JSON value."
},
"v1AddOrgDomainRequest": {
"type": "object",
"properties": {
@ -3791,7 +3849,7 @@
"type": "string"
},
"data": {
"type": "object"
"$ref": "#/definitions/protobufStruct"
}
}
},
@ -5168,9 +5226,6 @@
"user_id": {
"type": "string"
},
"org_id": {
"type": "string"
},
"project_grant_id": {
"type": "string"
},

View File

@ -148,7 +148,7 @@ func (s *Server) ProjectGrantUserGrantByID(ctx context.Context, request *Project
}
func (s *Server) CreateProjectGrantUserGrant(ctx context.Context, in *ProjectGrantUserGrantCreate) (*UserGrant, error) {
user, err := s.usergrant.ChangeUserGrant(ctx, projectGrantUserGrantCreateToModel(in))
user, err := s.usergrant.AddUserGrant(ctx, projectGrantUserGrantCreateToModel(in))
if err != nil {
return nil, err
}

View File

@ -2528,10 +2528,9 @@ message ProjectGrantUserGrantID {
message ProjectGrantUserGrantCreate {
string user_id = 1;
string org_id = 2;
string project_grant_id = 3;
string project_id = 4 [(validate.rules).string.min_len = 1];
repeated string role_keys = 5;
string project_grant_id = 2;
string project_id = 3 [(validate.rules).string.min_len = 1];
repeated string role_keys = 4;
}
message ProjectGrantUserGrantUpdate {