MCPcopy Create free account
hub / github.com/OpenCSGs/csghub-server / GetMemberRole

Method GetMemberRole

user/handler/member.go:205–216  ·  view source on GitHub ↗

GetMemberRole godoc @Security ApiKey @Summary Get user's role in an org @Tags Member @Accept json @Produce json @Param namespace path string true "org name" @Param username path string true "user name" @Param current_user query string false "the op

(ctx *gin.Context)

Source from the content-addressed store, hash-verified

203// @Failure 500 {object} types.APIInternalServerError "Internal server error"
204// @Router /organization/{namespace}/members/{username} [get]
205func (h *MemberHandler) GetMemberRole(ctx *gin.Context) {
206 org := ctx.Param("namespace")
207 userName := ctx.Param("username")
208 // Assuming GetMemberRole returns a role (or similar) and an error
209 role, err := h.c.GetMemberRole(ctx.Request.Context(), org, userName)
210 if err != nil {
211 httpbase.ServerError(ctx, err)
212 return
213 }
214
215 httpbase.OK(ctx, role)
216}

Callers

nothing calls this directly

Calls 3

ServerErrorFunction · 0.92
OKFunction · 0.92
GetMemberRoleMethod · 0.65

Tested by

no test coverage detected