MCPcopy Index your code
hub / github.com/gogs/gogs / ChangeOrgUserStatus

Function ChangeOrgUserStatus

internal/database/org.go:320–332  ·  view source on GitHub ↗

ChangeOrgUserStatus changes public or private membership status.

(orgID, uid int64, public bool)

Source from the content-addressed store, hash-verified

318
319// ChangeOrgUserStatus changes public or private membership status.
320func ChangeOrgUserStatus(orgID, uid int64, public bool) error {
321 ou := new(OrgUser)
322 has, err := x.Where("uid=?", uid).And("org_id=?", orgID).Get(ou)
323 if err != nil {
324 return err
325 } else if !has {
326 return nil
327 }
328
329 ou.IsPublic = public
330 _, err = x.Id(ou.ID).AllCols().Update(ou)
331 return err
332}
333
334// AddOrgUser adds new user to given organization.
335func AddOrgUser(orgID, uid int64) error {

Callers 1

MembersActionFunction · 0.92

Calls 3

WhereMethod · 0.80
GetMethod · 0.65
UpdateMethod · 0.65

Tested by

no test coverage detected