mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-05 16:52:07 +00:00
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:
@@ -62,6 +62,14 @@ func (repo *ProjectRepo) SearchGrantedProjects(ctx context.Context, request *pro
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (repo *ProjectRepo) GetGrantedProjectGrantByIDs(ctx context.Context, projectID, grantID string) (project *proj_model.GrantedProjectView, err error) {
|
||||
p, err := repo.View.GrantedProjectGrantByIDs(projectID, grantID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return model.GrantedProjectToModel(p), nil
|
||||
}
|
||||
|
||||
func (repo *ProjectRepo) ProjectMemberByID(ctx context.Context, projectID, userID string) (member *proj_model.ProjectMember, err error) {
|
||||
member = proj_model.NewProjectMember(projectID, userID)
|
||||
return repo.ProjectEvents.ProjectMemberByIDs(ctx, member)
|
||||
|
||||
@@ -15,6 +15,10 @@ func (v *View) GrantedProjectByIDs(projectID, orgID string) (*model.GrantedProje
|
||||
return view.GrantedProjectByIDs(v.Db, grantedProjectTable, projectID, orgID)
|
||||
}
|
||||
|
||||
func (v *View) GrantedProjectGrantByIDs(projectID, grantID string) (*model.GrantedProjectView, error) {
|
||||
return view.GrantedProjectGrantByIDs(v.Db, grantedProjectTable, projectID, grantID)
|
||||
}
|
||||
|
||||
func (v *View) GrantedProjectsByID(projectID string) ([]*model.GrantedProjectView, error) {
|
||||
return view.GrantedProjectsByID(v.Db, grantedProjectTable, projectID)
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ type ProjectRepository interface {
|
||||
DeactivateProject(ctx context.Context, id string) (*model.Project, error)
|
||||
ReactivateProject(ctx context.Context, id string) (*model.Project, error)
|
||||
SearchGrantedProjects(ctx context.Context, request *model.GrantedProjectSearchRequest) (*model.GrantedProjectSearchResponse, error)
|
||||
GetGrantedProjectGrantByIDs(ctx context.Context, projectID, grantID string) (*model.GrantedProjectView, error)
|
||||
|
||||
ProjectMemberByID(ctx context.Context, projectID, userID string) (*model.ProjectMember, error)
|
||||
AddProjectMember(ctx context.Context, member *model.ProjectMember) (*model.ProjectMember, error)
|
||||
|
||||
Reference in New Issue
Block a user