MCPcopy Index your code
hub / github.com/rilldata/rill / getAttributesForProjectMember

Method getAttributesForProjectMember

admin/server/reports.go:825–846  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

823
824// getAttributesForProjectMember returns user attributes for a given email only if the user is a member of the project.
825func (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
848var reportNameToDashCharsRegexp = regexp.MustCompile(`[ _]+`)
849

Callers 1

GetReportMetaMethod · 0.95

Calls 2

getAttributesForUserMethod · 0.95
FindUserByEmailMethod · 0.65

Tested by

no test coverage detected