Documentation
¶
Index ¶
- Constants
- func AddOrgUser(ctx context.Context, orgID, uid int64) error
- func AddTeamRepo(ctx context.Context, orgID, teamID, repoID int64) error
- func CanCreateOrgRepo(ctx context.Context, orgID, uid int64) (bool, error)
- func ChangeOrgUserStatus(ctx context.Context, orgID, uid int64, public bool) error
- func CountOrgMembers(ctx context.Context, opts *FindOrgMembersOpts) (int64, error)
- func CreateOrgPinnedGroup(ctx context.Context, group *OrgPinnedGroup) error
- func CreateOrgPinnedRepo(ctx context.Context, pinned *OrgPinnedRepo) error
- func CreateOrganization(ctx context.Context, org *Organization, owner *user_model.User) (err error)
- func DeleteOrgPinnedGroup(ctx context.Context, groupID int64) error
- func DeleteOrgPinnedRepo(ctx context.Context, orgID, repoID int64) error
- func DeleteOrgPinnedRepoByID(ctx context.Context, id int64) error
- func DoerViewOtherVisibility(doer, other *user_model.User) structs.VisibleType
- func FindOrgMembers(ctx context.Context, opts *FindOrgMembersOpts) (user_model.UserList, map[int64]bool, error)
- func GetMemberPublicVisibility(ctx context.Context, orgID, userID int64) (bool, error)
- func GetOrgAssignees(ctx context.Context, orgID int64) (_ []*user_model.User, err error)
- func GetOrgMemberAndTeamCounts(ctx context.Context, orgID int64) (memberCount, teamCount int64, err error)
- func GetOrgPinnedRepoIDs(ctx context.Context, orgID int64) ([]int64, error)
- func GetOrganizationCount(ctx context.Context, u *user_model.User) (int64, error)
- func GetTeamIDsByNames(ctx context.Context, orgID int64, names []string, ignoreNonExistent bool) ([]int64, error)
- func GetTeamMembers(ctx context.Context, opts *SearchMembersOptions) ([]*user_model.User, error)
- func GetTeamUserIDsWithAccessToAnyRepoUnit(ctx context.Context, orgID, repoID int64, mode perm.AccessMode, ...) (userIDs []int64, err error)
- func GetTeamsByIDs(ctx context.Context, teamIDs []int64) (map[int64]*Team, error)
- func GetUsersWhoCanCreateOrgRepo(ctx context.Context, orgID int64) (map[int64]*user_model.User, error)
- func HasOrgOrUserVisible(ctx context.Context, orgOrUser, user *user_model.User) bool
- func HasOrgsVisible(ctx context.Context, orgs []*Organization, user *user_model.User) bool
- func HasTeamRepo(ctx context.Context, orgID, teamID, repoID int64) bool
- func IncrTeamRepoNum(ctx context.Context, teamID int64) error
- func IsErrLastOrgOwner(err error) bool
- func IsErrOrgNotExist(err error) bool
- func IsErrTeamAlreadyExist(err error) bool
- func IsErrTeamInviteAlreadyExist(err error) bool
- func IsErrTeamInviteNotFound(err error) bool
- func IsErrTeamNotExist(err error) bool
- func IsErrUserEmailAlreadyAdded(err error) bool
- func IsErrUserHasOrgs(err error) bool
- func IsErrUserNotAllowedCreateOrg(err error) bool
- func IsOrganizationAdmin(ctx context.Context, orgID, uid int64) (bool, error)
- func IsOrganizationMember(ctx context.Context, orgID, uid int64) (bool, error)
- func IsOrganizationOwner(ctx context.Context, orgID, uid int64) (bool, error)
- func IsPublicMembership(ctx context.Context, orgID, uid int64) (bool, error)
- func IsRepoPinned(ctx context.Context, orgID, repoID int64) (bool, error)
- func IsTeamMember(ctx context.Context, orgID, teamID, userID int64) (bool, error)
- func IsUsableTeamName(name string) error
- func IsUserInTeams(ctx context.Context, userID int64, teamIDs []int64) (bool, error)
- func IsUserOrgOwner(ctx context.Context, users user_model.UserList, orgID int64) map[int64]bool
- func LoadPinnedRepoGroups(ctx context.Context, pinnedRepos []*OrgPinnedRepo, orgID int64) error
- func RemoveInviteByID(ctx context.Context, inviteID, teamID int64) error
- func RemoveOrgRepo(ctx context.Context, orgID, repoID int64) error
- func RemoveTeamRepo(ctx context.Context, teamID, repoID int64) error
- func ReorderOrgPinnedGroups(ctx context.Context, orgID int64, groupOrders []PinnedGroupOrder) error
- func ReorderOrgPinnedRepos(ctx context.Context, orgID int64, repoOrders []PinnedRepoOrder) error
- func SetMemberPublicVisibility(ctx context.Context, orgID, userID int64, isPublic bool) error
- func UpdateOrgPinnedGroup(ctx context.Context, group *OrgPinnedGroup) error
- func UpdateOrgPinnedRepo(ctx context.Context, pinned *OrgPinnedRepo) error
- func UpdateTeamUnits(ctx context.Context, team *Team, units []TeamUnit) (err error)
- func UsersInTeamsCount(ctx context.Context, userIDs, teamIDs []int64) (int64, error)
- type ErrLastOrgOwner
- type ErrOrgNotExist
- type ErrOrgPinnedGroupNotExist
- type ErrOrgPinnedRepoAlreadyExist
- type ErrTeamAlreadyExist
- type ErrTeamInviteAlreadyExist
- type ErrTeamInviteNotFound
- type ErrTeamNotExist
- type ErrUserEmailAlreadyAdded
- type ErrUserHasOrgs
- type ErrUserNotAllowedCreateOrg
- type FindOrgMembersOpts
- type FindOrgOptions
- type MinimalOrg
- type OrgList
- type OrgOverviewStats
- type OrgPinnedGroup
- type OrgPinnedRepo
- type OrgUser
- type Organization
- func GetHomepagePinnedOrganizations(ctx context.Context) ([]*Organization, error)
- func GetOrgByID(ctx context.Context, id int64) (*Organization, error)
- func GetOrgByName(ctx context.Context, name string) (*Organization, error)
- func GetOrgsCanCreateRepoByUserID(ctx context.Context, userID int64) ([]*Organization, error)
- func OrgFromUser(user *user_model.User) *Organization
- func (org *Organization) AsUser() *user_model.User
- func (org *Organization) AvatarLink(ctx context.Context) string
- func (org *Organization) CanCreateOrgRepo(ctx context.Context, uid int64) (bool, error)
- func (org *Organization) CustomAvatarRelativePath() string
- func (org *Organization) DisplayName() string
- func (org *Organization) GetMembers(ctx context.Context, doer *user_model.User) (user_model.UserList, map[int64]bool, error)
- func (org *Organization) GetOrgUserMaxAuthorizeLevel(ctx context.Context, uid int64) (perm.AccessMode, error)
- func (org *Organization) GetOwnerTeam(ctx context.Context) (*Team, error)
- func (org *Organization) GetTeam(ctx context.Context, name string) (*Team, error)
- func (org *Organization) GetUserTeamIDs(ctx context.Context, userID int64) ([]int64, error)
- func (org *Organization) GetUserTeams(ctx context.Context, userID int64, cols ...string) ([]*Team, error)
- func (org *Organization) HTMLURL(ctx context.Context) string
- func (org *Organization) HasMemberWithUserID(ctx context.Context, userID int64) bool
- func (org *Organization) HomeLink() string
- func (org *Organization) IsOrgAdmin(ctx context.Context, uid int64) (bool, error)
- func (org *Organization) IsOrgMember(ctx context.Context, uid int64) (bool, error)
- func (org *Organization) IsOwnedBy(ctx context.Context, uid int64) (bool, error)
- func (org *Organization) LoadTeams(ctx context.Context) ([]*Team, error)
- func (org *Organization) OrganisationLink() string
- func (org *Organization) SetHomepagePinned(ctx context.Context, pinned bool) error
- func (org *Organization) ShortName(length int) string
- func (Organization) TableName() string
- func (org *Organization) UnitPermission(ctx context.Context, doer *user_model.User, unitType unit.Type) perm.AccessMode
- type PinnedGroupOrder
- type PinnedRepoOrder
- type PublicMember
- type SearchMembersOptions
- type SearchOrganizationsOptions
- type SearchTeamOptions
- type Team
- func FindOrgTeams(ctx context.Context, orgID int64) ([]*Team, error)
- func GetOwnerTeam(ctx context.Context, orgID int64) (*Team, error)
- func GetTeam(ctx context.Context, orgID int64, name string) (*Team, error)
- func GetTeamByID(ctx context.Context, teamID int64) (*Team, error)
- func GetTeamsWithAccessToAnyRepoUnit(ctx context.Context, orgID, repoID int64, mode perm.AccessMode, ...) (teams []*Team, err error)
- func (t *Team) GetUnitNames() (res []string)
- func (t *Team) GetUnitsMap() map[string]string
- func (t *Team) HasAdminAccess() bool
- func (t *Team) IsMember(ctx context.Context, userID int64) bool
- func (t *Team) IsOwnerTeam() bool
- func (t *Team) LoadMembers(ctx context.Context) (err error)
- func (t *Team) LoadUnits(ctx context.Context) (err error)
- func (t *Team) LogString() string
- func (t *Team) UnitAccessMode(ctx context.Context, tp unit.Type) perm.AccessMode
- func (t *Team) UnitAccessModeEx(ctx context.Context, tp unit.Type) (accessMode perm.AccessMode, exist bool)
- func (t *Team) UnitEnabled(ctx context.Context, tp unit.Type) bool
- type TeamInvite
- type TeamList
- func GetRepoTeams(ctx context.Context, orgID, repoID int64) (teams TeamList, err error)
- func GetTeamsByOrgIDs(ctx context.Context, orgIDs []int64) (TeamList, error)
- func GetUserOrgTeams(ctx context.Context, orgID, userID int64) (teams TeamList, err error)
- func GetUserRepoTeams(ctx context.Context, orgID, userID, repoID int64) (teams TeamList, err error)
- func SearchTeam(ctx context.Context, opts *SearchTeamOptions) (TeamList, int64, error)
- type TeamRepo
- type TeamUnit
- type TeamUser
- type WorktimeSumByMembers
- type WorktimeSumByMilestones
- type WorktimeSumByRepos
Constants ¶
const ( // ProfileRepoName is the name of the special profile repository ProfileRepoName = ".profile" // ProfileReadmePath is the path to the profile README ProfileReadmePath = "README.md" // ProfileAssetsPath is the path to profile assets ProfileAssetsPath = "assets/" // ProfileStylePath is the path to custom CSS ProfileStylePath = "style.css" )
const OwnerTeamName = "Owners"
OwnerTeamName return the owner team name
Variables ¶
This section is empty.
Functions ¶
func AddOrgUser ¶
AddOrgUser adds new user to given organization.
func AddTeamRepo ¶
AddTeamRepo adds a repo for an organization's team
func CanCreateOrgRepo ¶
CanCreateOrgRepo returns true if user can create repo in organization
func ChangeOrgUserStatus ¶
ChangeOrgUserStatus changes public or private membership status.
func CountOrgMembers ¶
func CountOrgMembers(ctx context.Context, opts *FindOrgMembersOpts) (int64, error)
CountOrgMembers counts the organization's members
func CreateOrgPinnedGroup ¶
func CreateOrgPinnedGroup(ctx context.Context, group *OrgPinnedGroup) error
CreateOrgPinnedGroup creates a new pinned group for an organization
func CreateOrgPinnedRepo ¶
func CreateOrgPinnedRepo(ctx context.Context, pinned *OrgPinnedRepo) error
CreateOrgPinnedRepo pins a repository to an organization
func CreateOrganization ¶
func CreateOrganization(ctx context.Context, org *Organization, owner *user_model.User) (err error)
CreateOrganization creates record of a new organization.
func DeleteOrgPinnedGroup ¶
DeleteOrgPinnedGroup deletes a pinned group and moves its repos to ungrouped
func DeleteOrgPinnedRepo ¶
DeleteOrgPinnedRepo unpins a repository from an organization
func DeleteOrgPinnedRepoByID ¶
DeleteOrgPinnedRepoByID unpins a repository by pinned ID
func DoerViewOtherVisibility ¶
func DoerViewOtherVisibility(doer, other *user_model.User) structs.VisibleType
func FindOrgMembers ¶
func FindOrgMembers(ctx context.Context, opts *FindOrgMembersOpts) (user_model.UserList, map[int64]bool, error)
FindOrgMembers loads organization members according conditions
func GetMemberPublicVisibility ¶
GetMemberPublicVisibility gets the public visibility status of a member
func GetOrgAssignees ¶
GetOrgAssignees returns all users that have write access and can be assigned to issues of the any repository in the organization.
func GetOrgMemberAndTeamCounts ¶
func GetOrgMemberAndTeamCounts(ctx context.Context, orgID int64) (memberCount, teamCount int64, err error)
GetOrgMemberAndTeamCounts returns member and team counts for an organization
func GetOrgPinnedRepoIDs ¶
GetOrgPinnedRepoIDs returns the repo IDs of all pinned repos for an organization
func GetOrganizationCount ¶
GetOrganizationCount returns count of membership of organization of the user.
func GetTeamIDsByNames ¶
func GetTeamIDsByNames(ctx context.Context, orgID int64, names []string, ignoreNonExistent bool) ([]int64, error)
GetTeamIDsByNames returns a slice of team ids corresponds to names.
func GetTeamMembers ¶
func GetTeamMembers(ctx context.Context, opts *SearchMembersOptions) ([]*user_model.User, error)
GetTeamMembers returns all members in given team of organization.
func GetTeamUserIDsWithAccessToAnyRepoUnit ¶
func GetTeamsByIDs ¶
func GetUsersWhoCanCreateOrgRepo ¶
func GetUsersWhoCanCreateOrgRepo(ctx context.Context, orgID int64) (map[int64]*user_model.User, error)
GetUsersWhoCanCreateOrgRepo returns users which are able to create repo in organization
func HasOrgOrUserVisible ¶
func HasOrgOrUserVisible(ctx context.Context, orgOrUser, user *user_model.User) bool
HasOrgOrUserVisible tells if the given user can see the given org or user
func HasOrgsVisible ¶
func HasOrgsVisible(ctx context.Context, orgs []*Organization, user *user_model.User) bool
HasOrgsVisible tells if the given user can see at least one of the orgs provided
func HasTeamRepo ¶
HasTeamRepo returns true if given repository belongs to team.
func IncrTeamRepoNum ¶
IncrTeamRepoNum increases the number of repos for the given team by 1
func IsErrLastOrgOwner ¶
IsErrLastOrgOwner checks if an error is a ErrLastOrgOwner.
func IsErrOrgNotExist ¶
IsErrOrgNotExist checks if an error is a ErrOrgNotExist.
func IsErrTeamAlreadyExist ¶
IsErrTeamAlreadyExist checks if an error is a ErrTeamAlreadyExist.
func IsErrTeamNotExist ¶
IsErrTeamNotExist checks if an error is a ErrTeamNotExist.
func IsErrUserEmailAlreadyAdded ¶
IsErrUserEmailAlreadyAdded checks if an error is a ErrUserEmailAlreadyAdded.
func IsErrUserHasOrgs ¶
IsErrUserHasOrgs checks if an error is a ErrUserHasOrgs.
func IsErrUserNotAllowedCreateOrg ¶
IsErrUserNotAllowedCreateOrg checks if an error is an ErrUserNotAllowedCreateOrg.
func IsOrganizationAdmin ¶
IsOrganizationAdmin returns true if given user is in the owner team or an admin team.
func IsOrganizationMember ¶
IsOrganizationMember returns true if given user is member of organization.
func IsOrganizationOwner ¶
IsOrganizationOwner returns true if given user is in the owner team.
func IsPublicMembership ¶
IsPublicMembership returns true if the given user's membership of given org is public.
func IsRepoPinned ¶
IsRepoPinned checks if a repo is already pinned for an organization
func IsTeamMember ¶
IsTeamMember returns true if given user is a member of team.
func IsUsableTeamName ¶
IsUsableTeamName tests if a name could be as team name
func IsUserInTeams ¶
IsUserInTeams returns if a user in some teams
func IsUserOrgOwner ¶
IsUserOrgOwner returns true if user is in the owner team of given organization.
func LoadPinnedRepoGroups ¶
func LoadPinnedRepoGroups(ctx context.Context, pinnedRepos []*OrgPinnedRepo, orgID int64) error
LoadPinnedRepoGroups loads the groups for pinned repos
func RemoveOrgRepo ¶
RemoveOrgRepo removes all team-repository relations of organization.
func RemoveTeamRepo ¶
RemoveTeamRepo remove repository from team
func ReorderOrgPinnedGroups ¶
func ReorderOrgPinnedGroups(ctx context.Context, orgID int64, groupOrders []PinnedGroupOrder) error
ReorderOrgPinnedGroups updates the display order of pinned groups
func ReorderOrgPinnedRepos ¶
func ReorderOrgPinnedRepos(ctx context.Context, orgID int64, repoOrders []PinnedRepoOrder) error
ReorderOrgPinnedRepos updates the display order of pinned repos
func SetMemberPublicVisibility ¶
SetMemberPublicVisibility sets the public visibility of a member
func UpdateOrgPinnedGroup ¶
func UpdateOrgPinnedGroup(ctx context.Context, group *OrgPinnedGroup) error
UpdateOrgPinnedGroup updates a pinned group
func UpdateOrgPinnedRepo ¶
func UpdateOrgPinnedRepo(ctx context.Context, pinned *OrgPinnedRepo) error
UpdateOrgPinnedRepo updates a pinned repo's group or order
func UpdateTeamUnits ¶
UpdateTeamUnits updates a teams's units
Types ¶
type ErrLastOrgOwner ¶
type ErrLastOrgOwner struct {
UID int64
}
ErrLastOrgOwner represents a "LastOrgOwner" kind of error.
func (ErrLastOrgOwner) Error ¶
func (err ErrLastOrgOwner) Error() string
type ErrOrgNotExist ¶
ErrOrgNotExist represents a "OrgNotExist" kind of error.
func (ErrOrgNotExist) Error ¶
func (err ErrOrgNotExist) Error() string
func (ErrOrgNotExist) Unwrap ¶
func (err ErrOrgNotExist) Unwrap() error
type ErrOrgPinnedGroupNotExist ¶
type ErrOrgPinnedGroupNotExist struct {
ID int64
}
ErrOrgPinnedGroupNotExist represents a "pinned group not exist" error
func (ErrOrgPinnedGroupNotExist) Error ¶
func (err ErrOrgPinnedGroupNotExist) Error() string
type ErrOrgPinnedRepoAlreadyExist ¶
ErrOrgPinnedRepoAlreadyExist represents a "repo already pinned" error
func (ErrOrgPinnedRepoAlreadyExist) Error ¶
func (err ErrOrgPinnedRepoAlreadyExist) Error() string
type ErrTeamAlreadyExist ¶
ErrTeamAlreadyExist represents a "TeamAlreadyExist" kind of error.
func (ErrTeamAlreadyExist) Error ¶
func (err ErrTeamAlreadyExist) Error() string
func (ErrTeamAlreadyExist) Unwrap ¶
func (err ErrTeamAlreadyExist) Unwrap() error
type ErrTeamInviteAlreadyExist ¶
func (ErrTeamInviteAlreadyExist) Error ¶
func (err ErrTeamInviteAlreadyExist) Error() string
func (ErrTeamInviteAlreadyExist) Unwrap ¶
func (err ErrTeamInviteAlreadyExist) Unwrap() error
type ErrTeamInviteNotFound ¶
type ErrTeamInviteNotFound struct {
Token string
}
func (ErrTeamInviteNotFound) Error ¶
func (err ErrTeamInviteNotFound) Error() string
func (ErrTeamInviteNotFound) Unwrap ¶
func (err ErrTeamInviteNotFound) Unwrap() error
type ErrTeamNotExist ¶
ErrTeamNotExist represents a "TeamNotExist" error
func (ErrTeamNotExist) Error ¶
func (err ErrTeamNotExist) Error() string
func (ErrTeamNotExist) Unwrap ¶
func (err ErrTeamNotExist) Unwrap() error
type ErrUserEmailAlreadyAdded ¶
type ErrUserEmailAlreadyAdded struct {
Email string
}
ErrUserEmailAlreadyAdded represents a "user by email already added to team" error.
func (ErrUserEmailAlreadyAdded) Error ¶
func (err ErrUserEmailAlreadyAdded) Error() string
func (ErrUserEmailAlreadyAdded) Unwrap ¶
func (err ErrUserEmailAlreadyAdded) Unwrap() error
type ErrUserHasOrgs ¶
type ErrUserHasOrgs struct {
UID int64
}
ErrUserHasOrgs represents a "UserHasOrgs" kind of error.
func (ErrUserHasOrgs) Error ¶
func (err ErrUserHasOrgs) Error() string
type ErrUserNotAllowedCreateOrg ¶
type ErrUserNotAllowedCreateOrg struct{}
ErrUserNotAllowedCreateOrg represents a "UserNotAllowedCreateOrg" kind of error.
func (ErrUserNotAllowedCreateOrg) Error ¶
func (err ErrUserNotAllowedCreateOrg) Error() string
func (ErrUserNotAllowedCreateOrg) Unwrap ¶
func (err ErrUserNotAllowedCreateOrg) Unwrap() error
type FindOrgMembersOpts ¶
type FindOrgMembersOpts struct {
db.ListOptions
Doer *user_model.User
IsDoerMember bool
OrgID int64
}
FindOrgMembersOpts represensts find org members conditions
func (FindOrgMembersOpts) PublicOnly ¶
func (opts FindOrgMembersOpts) PublicOnly() bool
type FindOrgOptions ¶
type FindOrgOptions struct {
db.ListOptions
UserID int64
IncludeVisibility structs.VisibleType
}
FindOrgOptions finds orgs options
func (FindOrgOptions) ToConds ¶
func (opts FindOrgOptions) ToConds() builder.Cond
func (FindOrgOptions) ToOrders ¶
func (opts FindOrgOptions) ToOrders() string
type MinimalOrg ¶
type MinimalOrg = Organization
MinimalOrg represents a simple organization with only the needed columns
func GetUserOrgsList ¶
func GetUserOrgsList(ctx context.Context, user *user_model.User) ([]*MinimalOrg, error)
GetUserOrgsList returns all organizations the given user has access to
type OrgList ¶
type OrgList []*Organization
type OrgOverviewStats ¶
type OrgOverviewStats struct {
TotalRepos int64
TotalMembers int64
TotalTeams int64
TotalStars int64
}
OrgOverviewStats represents statistics for the organization overview
type OrgPinnedGroup ¶
type OrgPinnedGroup struct {
ID int64 `xorm:"pk autoincr"`
OrgID int64 `xorm:"INDEX NOT NULL"`
Name string `xorm:"NOT NULL"`
DisplayOrder int `xorm:"DEFAULT 0"`
Collapsed bool `xorm:"DEFAULT false"`
CreatedUnix timeutil.TimeStamp `xorm:"created"`
UpdatedUnix timeutil.TimeStamp `xorm:"updated"`
}
OrgPinnedGroup represents a named group of pinned repositories for an organization
func GetOrgPinnedGroup ¶
func GetOrgPinnedGroup(ctx context.Context, id int64) (*OrgPinnedGroup, error)
GetOrgPinnedGroup returns a pinned group by ID
func GetOrgPinnedGroups ¶
func GetOrgPinnedGroups(ctx context.Context, orgID int64) ([]*OrgPinnedGroup, error)
GetOrgPinnedGroups returns all pinned groups for an organization
func (*OrgPinnedGroup) TableName ¶
func (g *OrgPinnedGroup) TableName() string
TableName returns the table name for OrgPinnedGroup
type OrgPinnedRepo ¶
type OrgPinnedRepo struct {
ID int64 `xorm:"pk autoincr"`
OrgID int64 `xorm:"INDEX NOT NULL"`
RepoID int64 `xorm:"INDEX NOT NULL"`
GroupID int64 `xorm:"INDEX"` // 0 = ungrouped
DisplayOrder int `xorm:"DEFAULT 0"`
CreatedUnix timeutil.TimeStamp `xorm:"created"`
Repo any `xorm:"-"` // Will be set by caller (repo_model.Repository)
Group *OrgPinnedGroup `xorm:"-"`
}
OrgPinnedRepo represents a pinned repository for an organization
func GetOrgPinnedRepos ¶
func GetOrgPinnedRepos(ctx context.Context, orgID int64) ([]*OrgPinnedRepo, error)
GetOrgPinnedRepos returns all pinned repos for an organization
func (*OrgPinnedRepo) TableName ¶
func (p *OrgPinnedRepo) TableName() string
TableName returns the table name for OrgPinnedRepo
type OrgUser ¶
type OrgUser struct {
ID int64 `xorm:"pk autoincr"`
UID int64 `xorm:"INDEX UNIQUE(s)"`
OrgID int64 `xorm:"INDEX UNIQUE(s)"`
IsPublic bool `xorm:"INDEX"`
}
OrgUser represents an organization-user relation.
type Organization ¶
type Organization user_model.User
Organization represents an organization
func GetHomepagePinnedOrganizations ¶
func GetHomepagePinnedOrganizations(ctx context.Context) ([]*Organization, error)
GetHomepagePinnedOrganizations returns all organizations that are pinned to the homepage
func GetOrgByID ¶
func GetOrgByID(ctx context.Context, id int64) (*Organization, error)
GetOrgByID returns the user object by given ID if exists.
func GetOrgByName ¶
func GetOrgByName(ctx context.Context, name string) (*Organization, error)
GetOrgByName returns organization by given name.
func GetOrgsCanCreateRepoByUserID ¶
func GetOrgsCanCreateRepoByUserID(ctx context.Context, userID int64) ([]*Organization, error)
GetOrgsCanCreateRepoByUserID returns a list of organizations where given user ID are allowed to create repos.
func OrgFromUser ¶
func OrgFromUser(user *user_model.User) *Organization
OrgFromUser converts user to organization
func (*Organization) AsUser ¶
func (org *Organization) AsUser() *user_model.User
AsUser returns the org as user object
func (*Organization) AvatarLink ¶
func (org *Organization) AvatarLink(ctx context.Context) string
AvatarLink returns the full avatar link with http host
func (*Organization) CanCreateOrgRepo ¶
CanCreateOrgRepo returns true if given user can create repo in organization
func (*Organization) CustomAvatarRelativePath ¶
func (org *Organization) CustomAvatarRelativePath() string
CustomAvatarRelativePath returns user custom avatar relative path.
func (*Organization) DisplayName ¶
func (org *Organization) DisplayName() string
DisplayName returns full name if it's not empty, returns username otherwise.
func (*Organization) GetMembers ¶
func (org *Organization) GetMembers(ctx context.Context, doer *user_model.User) (user_model.UserList, map[int64]bool, error)
GetMembers returns all members of organization.
func (*Organization) GetOrgUserMaxAuthorizeLevel ¶
func (org *Organization) GetOrgUserMaxAuthorizeLevel(ctx context.Context, uid int64) (perm.AccessMode, error)
GetOrgUserMaxAuthorizeLevel returns highest authorize level of user in an organization
func (*Organization) GetOwnerTeam ¶
func (org *Organization) GetOwnerTeam(ctx context.Context) (*Team, error)
GetOwnerTeam returns owner team of organization.
func (*Organization) GetTeam ¶
GetTeam returns named team of organization.
func (*Organization) GetUserTeamIDs ¶
GetUserTeamIDs returns of all team IDs of the organization that user is member of.
func (*Organization) GetUserTeams ¶
func (org *Organization) GetUserTeams(ctx context.Context, userID int64, cols ...string) ([]*Team, error)
GetUserTeams returns all teams that belong to user, and that the user has joined.
func (*Organization) HTMLURL ¶
func (org *Organization) HTMLURL(ctx context.Context) string
HTMLURL returns the organization's full link.
func (*Organization) HasMemberWithUserID ¶
func (org *Organization) HasMemberWithUserID(ctx context.Context, userID int64) bool
HasMemberWithUserID returns true if user with userID is part of the u organisation.
func (*Organization) HomeLink ¶
func (org *Organization) HomeLink() string
HomeLink returns the user or organization home page link.
func (*Organization) IsOrgAdmin ¶
IsOrgAdmin returns true if given user is in the owner team or an admin team.
func (*Organization) IsOrgMember ¶
IsOrgMember returns true if given user is member of organization.
func (*Organization) IsOwnedBy ¶
IsOwnedBy returns true if given user is in the owner team.
func (*Organization) LoadTeams ¶
func (org *Organization) LoadTeams(ctx context.Context) ([]*Team, error)
LoadTeams load teams if not loaded.
func (*Organization) OrganisationLink ¶
func (org *Organization) OrganisationLink() string
OrganisationLink returns the organization sub page link.
func (*Organization) SetHomepagePinned ¶
func (org *Organization) SetHomepagePinned(ctx context.Context, pinned bool) error
SetHomepagePinned updates the homepage pinned status for an organization
func (*Organization) ShortName ¶
func (org *Organization) ShortName(length int) string
ShortName ellipses username to length
func (Organization) TableName ¶
func (Organization) TableName() string
TableName represents the real table name of Organization
func (*Organization) UnitPermission ¶
func (org *Organization) UnitPermission(ctx context.Context, doer *user_model.User, unitType unit.Type) perm.AccessMode
UnitPermission returns unit permission
type PinnedGroupOrder ¶
type PinnedGroupOrder struct {
GroupID int64 `json:"group_id"`
DisplayOrder int `json:"display_order"`
}
PinnedGroupOrder represents the order for a pinned group
type PinnedRepoOrder ¶
type PinnedRepoOrder struct {
RepoID int64 `json:"repo_id"`
GroupID int64 `json:"group_id"`
DisplayOrder int `json:"display_order"`
}
PinnedRepoOrder represents the order for a pinned repo
type PublicMember ¶
type PublicMember struct {
*user_model.User
Role string // "Owner", "Admin", "Member"
}
PublicMember represents a public member of an organization for display
type SearchMembersOptions ¶
type SearchMembersOptions struct {
db.ListOptions
TeamID int64
}
SearchMembersOptions holds the search options
func (SearchMembersOptions) ToConds ¶
func (opts SearchMembersOptions) ToConds() builder.Cond
type SearchOrganizationsOptions ¶
type SearchOrganizationsOptions struct {
db.ListOptions
All bool
}
SearchOrganizationsOptions options to filter organizations
type SearchTeamOptions ¶
type SearchTeamOptions struct {
db.ListOptions
UserID int64
Keyword string
OrgID int64
IncludeDesc bool
}
SearchTeamOptions holds the search options
type Team ¶
type Team struct {
ID int64 `xorm:"pk autoincr"`
OrgID int64 `xorm:"INDEX"`
LowerName string
Name string
Description string
AccessMode perm.AccessMode `xorm:"'authorize'"`
Members []*user_model.User `xorm:"-"`
NumRepos int
NumMembers int
Units []*TeamUnit `xorm:"-"`
IncludesAllRepositories bool `xorm:"NOT NULL DEFAULT false"`
CanCreateOrgRepo bool `xorm:"NOT NULL DEFAULT false"`
}
Team represents a organization team.
func FindOrgTeams ¶
FindOrgTeams returns all teams of a given organization
func GetOwnerTeam ¶
GetOwnerTeam returns team by given team name and organization.
func GetTeam ¶
GetTeam returns team by given team name and organization.
func GetTeamByID ¶
GetTeamByID returns team by given ID.
func GetTeamsWithAccessToAnyRepoUnit ¶
func GetTeamsWithAccessToAnyRepoUnit(ctx context.Context, orgID, repoID int64, mode perm.AccessMode, unitType unit.Type, unitTypesMore ...unit.Type) (teams []*Team, err error)
GetTeamsWithAccessToAnyRepoUnit returns all teams in an organization that have given access level to the repository special unit. This function is only used for finding some teams that can be used as branch protection allowlist or reviewers, it isn't really used for access control. FIXME: TEAM-UNIT-PERMISSION this logic is not complete, search the fixme keyword to see more details
func (*Team) GetUnitNames ¶
GetUnitNames returns the team units names
func (*Team) GetUnitsMap ¶
GetUnitsMap returns the team units permissions
func (*Team) IsMember ¶
IsMember returns true if given user is a member of team.
func (*Team) IsOwnerTeam ¶
IsOwnerTeam returns true if team is owner team.
func (*Team) LoadMembers ¶
LoadMembers returns paginated members in team of organization.
func (*Team) LoadUnits ¶
LoadUnits load a list of available units for a team
func (*Team) UnitAccessMode ¶
UnitAccessMode returns the access mode for the given unit type, "none" for non-existent units
func (*Team) UnitAccessModeEx ¶
type TeamInvite ¶
type TeamInvite struct {
ID int64 `xorm:"pk autoincr"`
Token string `xorm:"UNIQUE(token) INDEX NOT NULL DEFAULT ''"`
InviterID int64 `xorm:"NOT NULL DEFAULT 0"`
OrgID int64 `xorm:"INDEX NOT NULL DEFAULT 0"`
TeamID int64 `xorm:"UNIQUE(team_mail) INDEX NOT NULL DEFAULT 0"`
Email string `xorm:"UNIQUE(team_mail) NOT NULL DEFAULT ''"`
CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"`
UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"`
}
TeamInvite represents an invite to a team
func CreateTeamInvite ¶
func CreateTeamInvite(ctx context.Context, doer *user_model.User, team *Team, email string) (*TeamInvite, error)
type TeamList ¶
type TeamList []*Team
func GetRepoTeams ¶
GetRepoTeams gets the list of teams that has access to the repository
func GetTeamsByOrgIDs ¶
func GetUserOrgTeams ¶
GetUserOrgTeams returns all teams that user belongs to in given organization.
func GetUserRepoTeams ¶
GetUserRepoTeams returns user repo's teams
func SearchTeam ¶
SearchTeam search for teams. Caller is responsible to check permissions.
type TeamRepo ¶
type TeamRepo struct {
ID int64 `xorm:"pk autoincr"`
OrgID int64 `xorm:"INDEX"`
TeamID int64 `xorm:"UNIQUE(s)"`
RepoID int64 `xorm:"UNIQUE(s)"`
}
TeamRepo represents an team-repository relation.
type TeamUnit ¶
type TeamUnit struct {
ID int64 `xorm:"pk autoincr"`
OrgID int64 `xorm:"INDEX"`
TeamID int64 `xorm:"UNIQUE(s)"`
Type unit.Type `xorm:"UNIQUE(s)"`
AccessMode perm.AccessMode
}
TeamUnit describes all units of a repository
type TeamUser ¶
type TeamUser struct {
ID int64 `xorm:"pk autoincr"`
OrgID int64 `xorm:"INDEX"`
TeamID int64 `xorm:"UNIQUE(s)"`
UID int64 `xorm:"UNIQUE(s)"`
}
TeamUser represents an team-user relation.
type WorktimeSumByMembers ¶
func GetWorktimeByMembers ¶
func GetWorktimeByMembers(ctx context.Context, org *Organization, unitFrom, unixTo int64) (results []WorktimeSumByMembers, err error)
type WorktimeSumByMilestones ¶
type WorktimeSumByMilestones struct {
RepoName string
MilestoneName string
MilestoneID int64
MilestoneDeadline int64
SumTime int64
HideRepoName bool
}
func GetWorktimeByMilestones ¶
func GetWorktimeByMilestones(ctx context.Context, org *Organization, unitFrom, unixTo int64) (results []WorktimeSumByMilestones, err error)
type WorktimeSumByRepos ¶
func GetWorktimeByRepos ¶
func GetWorktimeByRepos(ctx context.Context, org *Organization, unitFrom, unixTo int64) (results []WorktimeSumByRepos, err error)
Source Files
¶
- org.go
- org_list.go
- org_pinned.go
- org_profile.go
- org_user.go
- org_worktime.go
- team.go
- team_invite.go
- team_list.go
- team_repo.go
- team_unit.go
- team_user.go