API Endpoints for collaborators (#375)
This commit is contained in:
parent
2e7ccecfe6
commit
2342df183b
3 changed files with 108 additions and 1 deletions
|
@ -103,6 +103,15 @@ func (repo *Repository) GetCollaborators() ([]*Collaborator, error) {
|
|||
return repo.getCollaborators(x)
|
||||
}
|
||||
|
||||
func (repo *Repository) isCollaborator(e Engine, userID int64) (bool, error) {
|
||||
return e.Get(&Collaboration{RepoID: repo.ID, UserID: userID})
|
||||
}
|
||||
|
||||
// IsCollaborator check if a user is a collaborator of a repository
|
||||
func (repo *Repository) IsCollaborator(userID int64) (bool, error) {
|
||||
return repo.isCollaborator(x, userID)
|
||||
}
|
||||
|
||||
// ChangeCollaborationAccessMode sets new access mode for the collaboration.
|
||||
func (repo *Repository) ChangeCollaborationAccessMode(uid int64, mode AccessMode) error {
|
||||
// Discard invalid input
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue