mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-13 19:44:21 +00:00
3025ac577b
* search orgs * org by domain * member spooler * member * get roles * tests * types duration * use default func for renew * correct database * reorder migrations * delete unused consts * move get roles to internal * use prepared org by domain * implement org in other objects * add eventstores
41 lines
1.4 KiB
Go
41 lines
1.4 KiB
Go
package grpc
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/golang/protobuf/ptypes/empty"
|
|
)
|
|
|
|
func (s *Server) GetProjectGrantMemberRoles(ctx context.Context, _ *empty.Empty) (*ProjectGrantMemberRoles, error) {
|
|
return &ProjectGrantMemberRoles{Roles: s.project.GetProjectGrantMemberRoles()}, nil
|
|
}
|
|
|
|
func (s *Server) SearchProjectGrantMembers(ctx context.Context, in *ProjectGrantMemberSearchRequest) (*ProjectGrantMemberSearchResponse, error) {
|
|
response, err := s.project.SearchProjectGrantMembers(ctx, projectGrantMemberSearchRequestsToModel(in))
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return projectGrantMemberSearchResponseFromModel(response), nil
|
|
}
|
|
|
|
func (s *Server) AddProjectGrantMember(ctx context.Context, in *ProjectGrantMemberAdd) (*ProjectGrantMember, error) {
|
|
member, err := s.project.AddProjectGrantMember(ctx, projectGrantMemberAddToModel(in))
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return projectGrantMemberFromModel(member), nil
|
|
}
|
|
|
|
func (s *Server) ChangeProjectGrantMember(ctx context.Context, in *ProjectGrantMemberChange) (*ProjectGrantMember, error) {
|
|
member, err := s.project.ChangeProjectGrantMember(ctx, projectGrantMemberChangeToModel(in))
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return projectGrantMemberFromModel(member), nil
|
|
}
|
|
|
|
func (s *Server) RemoveProjectGrantMember(ctx context.Context, in *ProjectGrantMemberRemove) (*empty.Empty, error) {
|
|
err := s.project.RemoveProjectGrantMember(ctx, in.ProjectId, in.GrantId, in.UserId)
|
|
return &empty.Empty{}, err
|
|
}
|