fix: add project id on project grant (#202)

* fix: add project id on project grant

* fix: get granted project grant member
This commit is contained in:
Fabi
2020-06-10 14:28:15 +02:00
committed by GitHub
parent 652a408c99
commit 9965beee9c
9 changed files with 649 additions and 626 deletions
File diff suppressed because it is too large Load Diff
@@ -167,7 +167,7 @@
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v1ProjectGrant"
"$ref": "#/definitions/v1GrantedProject"
}
}
},
+3 -3
View File
@@ -65,12 +65,12 @@ func (s *Server) ProjectByID(ctx context.Context, id *ProjectID) (*Project, erro
return projectFromModel(project), nil
}
func (s *Server) GetGrantedProjectGrantByID(ctx context.Context, in *ProjectGrantID) (*ProjectGrant, error) {
project, err := s.project.ProjectGrantByID(ctx, in.ProjectId, in.Id)
func (s *Server) GetGrantedProjectGrantByID(ctx context.Context, in *ProjectGrantID) (*GrantedProject, error) {
project, err := s.project.GetGrantedProjectGrantByIDs(ctx, in.ProjectId, in.Id)
if err != nil {
return nil, err
}
return projectGrantFromModel(project), nil
return grantedProjectFromModel(project), nil
}
func (s *Server) AddProjectRole(ctx context.Context, in *ProjectRoleAdd) (*ProjectRole, error) {
@@ -23,6 +23,7 @@ func projectGrantFromModel(grant *proj_model.ProjectGrant) *ProjectGrant {
GrantedOrgId: grant.GrantedOrgID,
RoleKeys: grant.RoleKeys,
Sequence: grant.Sequence,
ProjectId: grant.AggregateID,
}
}
+1 -1
View File
@@ -641,7 +641,7 @@ service ManagementService {
}
//GRANTED_PROJECT_GRANTS
rpc GetGrantedProjectGrantByID(ProjectGrantID) returns (ProjectGrant) {
rpc GetGrantedProjectGrantByID(ProjectGrantID) returns (GrantedProject) {
option (google.api.http) = {
get: "/grantedprojects/{project_id}/grants/{id}"
};