getAttributesForProjectMember returns user attributes for a given email only if the user is a member of the project.
(ctx context.Context, email, orgID, projID string)
| 823 | |
| 824 | // getAttributesForProjectMember returns user attributes for a given email only if the user is a member of the project. |
| 825 | func (s *Server) getAttributesForProjectMember(ctx context.Context, email, orgID, projID string) (map[string]any, string, error) { |
| 826 | if email == "" { |
| 827 | return nil, "", nil |
| 828 | } |
| 829 | // Look up user by email |
| 830 | user, err := s.admin.DB.FindUserByEmail(ctx, email) |
| 831 | if err != nil && !errors.Is(err, database.ErrNotFound) { |
| 832 | return nil, "", err |
| 833 | } |
| 834 | if user == nil { |
| 835 | return nil, "", nil |
| 836 | } |
| 837 | |
| 838 | attr, id, readProd, err := s.getAttributesForUser(ctx, orgID, projID, user.ID, "") |
| 839 | if err != nil { |
| 840 | return nil, "", err |
| 841 | } |
| 842 | if !readProd { |
| 843 | return nil, "", nil |
| 844 | } |
| 845 | return attr, id, nil |
| 846 | } |
| 847 | |
| 848 | var reportNameToDashCharsRegexp = regexp.MustCompile(`[ _]+`) |
| 849 |
no test coverage detected